The function basename () is used for printing the basename of the file, e.g.
$name = "c:/wamp/www/dest.txt";
echo basename($name) ."<br/>";
The output of this example will print both the base name of the file with extension and basename without extension.
Recommend the tutorial