Loading…

How to check a variable is an array or not in PHP?

PHP developers use the is_array() function to determine whether a variable is an array or not. It is available for only PHP 4 and above versions.

Example

                                        

is_array (var_name)

$var = ['Best', 'Interview', 'Questions'];

if(is_array ($var)) {
     // True
}

Suggest An Answer

No suggestions avaliable!

Latest post from PHP interview questions

Ask Question