You mean, I think, that you want a function to know which page it is being used within. Then you need the Predefined variables
A simple case would be where the function is in a script that has been included into another script that the user requested
eg: user requested http://yourdomain.com/page1.php which has an include for a general purpose menu formatting script that needs to be context sensitive (a duff example I know but it will get the idea across)
$page_link = $_SERVER['REQUEST_URI'];
switch $page_link {
case "page1.php":
include 'page1_menu.php';
break;
case "page2.php:
include 'page2_menu.php';
break;
}
You should read the manual about the various options and relate them to your own situation, and pay particular attention to the user notes at the bottom.