1
2<?php
3$yes = array('this', 'is', 'an array');
4
5echo is_array($yes) ? 'Array' : 'not an Array';
6echo "\n";
7
8$no = 'this is a string';
9
10echo is_array($no) ? 'Array' : 'not an Array';
11?>
12
13
1PHP function is_array(mixed $value) bool
2----------------------------------------
3
4Finds whether a variable is an array
5
6Parameters:
7mixed--$value--The variable being evaluated.
8Returns: true if var is an array, false otherwise.
9
10Example:
11--------
12
13
14$yes = array('this', 'is', 'an array');
15
16echo is_array($yes) ? 'Array' : 'not an Array';
17
18echo "\n";
19output: Array
20
21
22$no = 'this is a string';
23
24echo is_array($no) ? 'Array' : 'not an Array';
25output: not an Array
26