When you want to isolate the base filename from a path string, this is the way to do it:
[sourcecode language='php']
$path = "/home/project/folder/mypage.php";
$file = basename($path); Â Â Â Â Â // $file is "mypage.php"
$file = basename($path, ".php"); Â Â Â // $file is "mypage"
[/sourcecode]
See dirname() and pathinfo() for related information.