Menu
Do u know how to get a php variable name ?
Suppose, I have defined a variable as $myvar=”my variable”;
I want to get the variable name by a function as below :
is_set($var){
if(isset($var)){
return $var; // I want to return the variable name not the value
}else{
return NULL;
}
}
for the purpose like :
$action=is_set($_REQUEST[‘view’]);
$action=is_set($
switch($action){
case “view” : include “action.view.php”; break;
case “add” : include “action.new.php”; break;
default : include action.default.php”; break;
}