is_countable
Description
The is_countable of Variable Handling for PHP verify that the contents of a variable is a countable value.
Syntax
is_countable(mixed $value): bool
Parameters
value
The value to check
Return
Returns true if value is countable, false otherwise.
Examples
1
<? $value = array(); $return = is_countable($value); var_export($return); ?>
true
2
<? $value = array(0, 1); $return = is_countable($value); var_export($return); ?>
true
3
<? $value = new ArrayIterator(); $return = is_countable($value); var_export($return); ?>
true
4
<? $array = array(0, 1); $value = new ArrayIterator($array); $return = is_countable($value); var_export($return); ?>
true
Links
Variable Handling
- boolval
- debug_zval_dump
- doubleval
- empty
- floatval
- get_debug_type
- get_defined_vars
- get_resource_id
- get_resource_type
- gettype
- intval
- is_array
- is_bool
- is_callable
- is_double
- is_float
- is_int
- is_integer
- is_iterable
- is_long
- is_null
- is_numeric
- is_object
- is_real
- is_resource
- is_scalar
- is_string
- isset
- print_r
- serialize
- settype
- strval
- unserialize
- unset
- var_dump
- var_export