PHP is_countable() Function
The PHP is_countable() function in PHP is used to find whether a variable is countable or not. It returns a Boolean value true if the parameter var is countable else it returns false.
Syntax
is_countable ( mixed $var )
Parameter
var(required)- This parameter represents the value to check.
Return
This function returns a Boolean value TRUE if the parameter var is countable, else it returns FALSE.
Example 1
Output
var is countable.
Example 2
Output
The var is countable
Example 3
Output
bool(true) bool(true)
Example 4
Output
bool(true) bool(false)