PHP.nl

is_countable

is_countable

Verify that the contents of a variable is a countable value

bool **is_countable** mixed $value

Verify that the contents of a variable is an or an object implementing array``Countable

valueThe value to check

Returns true if is countable, false otherwise. value

Voorbeeld: examples

<?php
var_dump(is_countable([1, 2, 3])); // bool(true)
var_dump(is_countable(new ArrayIterator(['foo', 'bar', 'baz']))); // bool(true)
var_dump(is_countable(new ArrayIterator())); // bool(true)
var_dump(is_countable(new stdClass())); // bool(false)
?>

is_array``is_object``is_iterable``is_bool