Well this is a Web Server issue not PHP, since PHP gets called by the web server when a file is to be parsed by the PHP Engine. What you want is mod_rewrite so something like this
untested
RewriteEngine on
RewriteRule ^([a-z]+)$ $1.php [NC]
Of course you may want to check the file actually exists and that it is a file and not a directory.