how to get the path of a file in php code example Example: php get url path name parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );