If you want user-friendly URLs on your site and hide .php extension then this post is useful for you.
Please follow below steps to hide .php file extensions :
# Open .htaccess file and add below rewrite rules
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [NC,L]
Now your server will remove .php file extension from all URLs
For example, http://example.com/file.php will become as http://example.com/file
Please also check https://www.l3webhosting.com/blog/remove-html-extension-with-the-help-of-htaccess-file/
It’s an remarkable post designed for all the internet users; they
will get benefit from it I am sure.