Check if a Function exists within a Class [PHP]

The following code returns a bool value of true or false:

<?
class Books
{
public function read()
{

}
public function find()
{

}
}

$class = new Books();
$function = "find";
$methodVariable = array($class, $function);
$function_exists = var_dump(is_callable($methodVariable));
echo $function_exists;
?>

Live example of above code.

Comments are closed.