Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
replace
.php with the extension you want to hide
add trailing slash
you will need to reference your target directory for this to work properly