The following small series will bring you an implementation method for PHPis_array () to check whether the variable is an array. I think this is quite good. now I will share it with you and give you a reference. let's take a look at it together.
Is_array ()
The PHP is_array () function is used to check whether a variable is an array. This function is especially used for security checks (such as form or SESSION checks ).
Syntax:
Bool is_array (mixed var) returns TRUE if var is array; otherwise, FALSE.
Example:
<? Php $ arr_age = array (18, 20, 25); if (is_array ($ arr_age) {echo 'variable $ arr_age is an array ';} else {echo 'variable $ arr_age is not an array';}?>
Run the sample output:
The variable $ arr_age is an array.
The above PHP is_array () check whether the variable is an array implementation method is all the content that I have shared with you. I hope you can give us a reference and also hope you can support me a lot.