1.

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

Answer»

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
}



Discussion

No Comment Found