Currently my code looks like that:
switch ($_POST[\'operation\']) { case \'create\': $db_manager->create(); break; case \'retrieve\':
You can use method_exists:
if (method_exists($db_manager, $_POST['operation'])){ $db_manager->{$_POST['operation']}(); } else { echo 'error'; }
Though I strongly advise you don't go about programming this way...