<?php
$url = "https://remote-url-path/filename.jpg";
echo basename($url);
?>
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.
0 Comments