Checking if a Variable is an Array in PHP


Use is_array() to find out whether a variable is an array.

Source Code

$yes = array('this', 'is', 'an array');
echo is_array($yes) ? 'Array' : 'not an Array';
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments