I\'m passing some post data to execute a function based on post data, to determine if this should execute I\'ve tried to use the following:
$SP = new StoredP
method_exists checks for method of a class for a given object:
Docs Link: http://www.php.net/method_exists
if(method_exists($SP, $_POST['function'])) {
{
$SP->$_POST['function']();
}
else
{
echo 'function does not exist.';
}
function_exists() and method_exists() are for these checks. First is for regular functions and second for OOP functions.