We can check a variable with the help of is_array() function in PHP. It's return true if variable is an array and return false otherwise.

Example

                                        

$var = array('X','Y','Z');
if (is_array($var))
echo 'It is an array.';
else
echo 'It is not an array.';

 

Suggest An Answer

No suggestions avaliable!