Remove PHP file extensions from end of URL

Code to remove an extension from the end of a URL. Could be used for other extensions