PHP | is_a() function Last Updated : 06 May, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Syntax: 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: Program 1: php <?php // PHP program to illustrate the // is_a() function // sample class class GeeksforGeeks { var $store = 'geek'; } // create a new object $geek = new GeeksforGeeks(); // checks if $geek is an object // of class GeeksforGeeks if (is_a($geek, 'GeeksforGeeks')) { echo "YES"; } ?> Output: YES Program 2: php <?php // PHP program to illustrate the // is_a() function interface parentClass { public function A(); } class childClass implements parentClass { public function A () { print "A"; } } $object = new childClass(); if(is_a($object, 'parentClass')) { echo "YES"; } else { echo "NO"; } ?> Output: YES Reference: http://php.net/manual/en/function.is-a.php Comment More infoAdvertise with us Next Article PHP is_file( ) Function S Shivani2609 Follow Improve Article Tags : Misc Web Technologies PHP Practice Tags : Misc Similar Reads PHP | is_array() Function The is_array() is an inbuilt function in PHP. The is_array() function is used to check whether a variable is an array or not. Syntax: bool is_array($variable_name) Parameter: This function accept a single parameter as mentioned above and described below: $variable_name: This parameter holds the vari 2 min read PHP is_float() Function PHP is_float() is an inbuilt function in PHP. The is_float() function is used to find whether a variable is a float or not. Syntax: boolean is_float($variable_name) Parameter: This function contains a single parameter as shown in the above syntax and described below $variable_name: the variable we w 2 min read PHP | is_dir( ) Function The is_dir() function in PHP used to check whether the specified file is a directory or not. The name of the file is sent as a parameter to the is_dir() function and it returns True if the file is a directory else it returns False. Syntax: is_dir($file) Parameters Used: The is_dir() function in PHP 1 min read PHP isset() Function The isset() function in PHP checks whether a variable is declared and not NULL. It returns true if the variable exists and has a non-NULL value, and false otherwise, without modifying the variable. Syntaxbool isset( mixed $var [, mixed $... ] )Parameters: This function accept one or more parameter a 3 min read PHP is_file( ) Function The is_file() function in PHP is an inbuilt function which is used to check whether the specified file is a regular file or not. The name of the file is sent as a parameter to the is_file() function and it returns True if the file is a regular file else it returns False. Syntax: bool is_file($file) 2 min read PHP in_array() Function The in_array() function in PHP is a built-in function that is used to check if a specific value exists within an array and returns a boolean result. Returns true if the value is found and false if the value is not found.Syntax:bool in_array(mixed $needle, array $haystack, bool $strict = false)In thi 3 min read Like