The is_a() is a built-in function in PHP and is used to check whether a given object is of a given class or not. It also checks if the given class is one of the parents of the given object or not.
boolean is_a($object, $class)
Parameters: This function accepts two parameters as shown in the above syntax and explained below:
- $object: The given object to be tested.
- $class: The name of the class.
Return Type: It returns TRUE if the object given by the parameter $object is of $class or has this $class as one of its parents otherwise it returns FALSE.
Below programs illustrate the is_a() function: