Check if a variable is a specific class
Posted on March 8, 2012
is_a — Checks if the object is of this class or has this class as one of its parents
bool is_a ( object $object , string $class_name [, bool $allow_string = FALSE ] )
Example
class exampleClass{
public function foo(){
echo "FOO";
}
}
$ex = new example();
if (!is_a($ex,"example")){
echo "var ex is not a example Class";
}