On my pages i usually do a big if/else/switch to decide which function to call
Is it possible to do sumthing like this:
$action['whatever'] = doThis();
$action['bob'] = doThis2();
Then how would I call the appropiate function to be called depending on the value of $_GET['action']?
Is it possible?
Is there another way to do what I want with less/tidy/efficient code?
Thx
PHP:
if ($_GET['action'] == 'whatever')
doThis();
else if ($_GET['action'] == 'bob')
doThis2();
Is it possible to do sumthing like this:
$action['whatever'] = doThis();
$action['bob'] = doThis2();
Then how would I call the appropiate function to be called depending on the value of $_GET['action']?
Is it possible?
Is there another way to do what I want with less/tidy/efficient code?
Thx