Thanks tekky, but the main point is how to decide which function to be call by $GET['id']
Check the value of $GET['id']
function output1() {
echo "Today is ".date('Y-m-d');
}
function output2() {
echo "Time is ".date('H:i:s');
}
if (isset($_GET['id'])) {
if ($_GET['id'] == 0) {
output1();
} else {
output2();
}
} else {
echo 'id not set';
}
It looks like you are trying to use variable functions, but in this case, with incoming variables, it is better done by checking values and calling the appropriate function.