Chrome Extension

Get file name form url in PHP

<?php
    $url = "https://remote-url-path/filename.jpg";
    echo basename($url);
?>
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now
Output
filename.jpg

If you want to get file name form a URL or path in PHP you can use basename() function in PHP. It will return the file filename when the URL is passed as a parameter.

Was this helpful?
0 Comments
Open Code Manager We are hiring