PHP is_iterable() Function
is_iterable() The function is used to check whether a variable is an iterable value.
PHP version requirement: PHP 7 >= 7.1.0
Syntax
bool is_iterable ( mixed $var )
Parameter Description:
- $var: the variable to check, which can be an array or an object implementing the Traversable interface.
Return Value
If the specified variable is an iterable object, returns TRUE; otherwise returns FALSE.
Example
Example
The output is:
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
Available PHP Functions