How to remove .php or .html on the browser by using htaccess

If you want to display your website's browser looks more simple and attractive, that is by eliminating .php or html, maybe you can use this trick, a way to use htaccess.
The trick is as follows:

1. Copy this code:
This is for html files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

And this is for php files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

2. Save with the name .htaccess, then upload in the root of your server
3. You can test it!
Official wiyono blog