PHP | is_array() Function Last Updated : 06 Jan, 2020 Summarize Comments Improve Suggest changes Share 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 Like