To get the file name from full path in PHP function basename() is used. It contains two parameters one is path(the path to from which you rquired a filename) and suffix(it specify the file extension. If the filename has this extension then it display the filename without extension.)
For example:
<?php
$path = "/var/www/demo.php";
//it will display filename with file extension
echo basename($path);
?>
The output of the above script will be as follows:
0 Comment(s)