This is the first function I've ever written, but I don't understand how to call it later on...
function clipfilename()
{
$pos1 = strpos(basename($SERVER['PHP_SELF']), '-');
$pos2 = strpos(basename($SERVER['PHP_SELF']), '');
if($pos2===false) {
$clip = substr(basename($SERVER['PHP_SELF']),3,-4);
print $clip;
}
else {
$clip = substr(basename($_SERVER['PHP_SELF']),3,-3+$pos2);
print $clip;
}
}
$uselater = $clip;
I want my variable $uselater to be one of two $clip variables from my function, but I don't understand how to call it. This is where I want to call it on a different page...
$links=array("07-".$uselater ."selecting".".php" =>"Selecting",
"07-".$uselater ."listening".".php" =>"Listening",
"07-".$uselater ."_history".".php" =>"History"
);
I want to end up with a dynamic menu of links. If this makes any sense, please help me rewrite this code. Thanks!!