Jan Walraven
DevOps



Menu
Categories:
Posted on

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”; }