Function Idea
Posted: Thu Dec 28, 2006 6:02 pm
Is this idea possible? I have a bunch of cases for my switch, and they are all exactly the same, except they each have one variable that changes with each one. I thought I should just make a function called SC, then use that, although it is not working.
Apache Err Msg:
Parse error: parse error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in C:\Documents and Settings\Administrator\My Documents\My Projects\Web Projects\Guava\guav-includes\lib_tags.php on line 31
IDE Err Msg:
Parser error "';' expected after expression (Found token: Variable($object))" - line 38
thnx all
Apache Err Msg:
Parse error: parse error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in C:\Documents and Settings\Administrator\My Documents\My Projects\Web Projects\Guava\guav-includes\lib_tags.php on line 31
IDE Err Msg:
Parser error "';' expected after expression (Found token: Variable($object))" - line 38
Code: Select all
function dir($arg)
{
switch ($arg){
SC('theme'); //Line 31
SC('admin');
SC('includes');
}
}
function SC($object)
{
case $object:
global $object; return $object;
break;
}
}