This might sound simple but I'm a bit stuck!
What I want to do is use a switch to control what is seen in a particular DIV. In an effort to keep this tidy (and for portability sake) I want to make the case statments all functions that are read from other php pages.
For example:
Code:
switch ( $transform )
{
case "test":
include 'foo.php'
function foo();
break;
case "test2":
include 'foo2.php'
function foo2();
default:
echo "Default";
break;
}
Foo.php contains:
Code:
<?
function foo()
{
echo "<div id=content2>
echo "Hello";
echo "</div>;
}
?>
etc.
However when I try that I get an unexpected T_FUNCTION error.
I'm probably doing something really daft but I just can't see it! Any ideas please?