PHP | is_array() Function Last Updated : 06 Jan, 2020 Comments Improve Suggest changes Like Article Like Report 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 variable we want to check. Return value: It is a boolean function so returns TRUE when $variable_name is a boolean value, otherwise FALSE. Below example illustrate the is_array() function in PHP. Example 1: PHP <?php // PHP code to demonstrate working of is_array() $variable_name1=67.099; $variable_name2=32; $variable_name3="abc"; $variable_name4=array('A', 'B', 'C'); // $variable_name4 is an array, returns TRUE if (is_array($variable_name4)) echo "array('A', 'B', 'C') is an array . \n"; else echo "array('A', 'B', 'C') is not a array value. \n"; // $variable_name1 is not array, gives FALSE if (is_array($variable_name1)) echo "$variable_name1 is a array value. \n"; else echo "$variable_name1 is not a array value. \n"; // $variable_name2 is not array, gives FALSE if (is_array($variable_name2)) echo "$variable_name2 is a array value. \n"; else echo "$variable_name2 is not a array value. \n"; // $variable_name3 is not array, gives FALSE if (is_array($variable_name3)) echo "$variable_name3 is a array value. \n"; else echo "$variable_name3 is not a array value. \n"; ?> Output: array('A', 'B', 'C') is an array . 67.099 is not a array value. 32 is not a array value. abc is not a array value. Reference: http://php.net/manual/en/function.is-array.php Comment More infoAdvertise with us Next Article PHP | is_array() Function S sid4321 Follow Improve Article Tags : Web Technologies PHP PHP-array Similar Reads 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 PHP Array Functions Arrays are one of the fundamental data structures in PHP. They are widely used to store multiple values in a single variable and can store different types of data, such as strings, integers, and even other arrays. PHP offers a large set of built-in functions to perform various operations on arrays. 7 min read PHP array() Function The array() function is an inbuilt function in PHP which is used to create an array. There are three types of array in PHP: Indexed array: The array which contains numeric index. Syntax: array( val1, val2, val3, ... ) Associative array: The array which contains name as keys. Syntax: array( key=>v 2 min read PHP array_keys() Function The array_keys() is a built-in function in PHP and is used to return either all the keys of and array or the subset of the keys. Syntax: array array_keys($input_array, $search_value, $strict) Parameters: The function takes three parameters out of which one is mandatory and other two are optional. $i 2 min read PHP array_is_list() Function The array_is_list() function is an inbuilt function in PHP that is used to check whether a given array is a list or not. If the given array will be a list if the key of the array contains consecutive numbers from 0 to count($arr)-1. Syntax:Â bool array_is_list(array $array) Parameters: This function 1 min read PHP | is_a() function 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 2 min read PHP | array_map() Function The array_map() is an inbuilt function in PHP and it helps to modify all elements one or more arrays according to some user-defined condition in an easy manner. It basically, sends each of the elements of an array to a user-defined function and returns an array with new values as modified by that fu 2 min read PHP array_intersect() Function This builtin function of PHP is used to compute the intersection of two or more arrays. The function is used to compare the values of two or more arrays and returns the matches. The function prints only those elements of the first array that are present in all other arrays. Syntax: array array_inter 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 array_walk() Function The array_walk() function is an inbuilt function in PHP. The array_walk() function walks through the entire array regardless of pointer position and applies a callback function or user-defined function to every element of the array. The array element's keys and values are parameters in the callback 2 min read Like