wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



is_iterable › WordPress Function

Seit4.9.6
Veraltetn/v
is_iterable ( $value )
Parameter:
  • (mixed) $value The value to check.
    Erforderlich: Ja
Gibt zurück:
  • (bool) True if `$value` is iterable, false otherwise.
Definiert in:
Codex:

Polyfill for is_iterable() function added in PHP 7.1.

Verify that the content of a variable is an array or an object implementing the Traversable interface.


Quellcode

function is_iterable( $value ) {
		return ( is_array( $value ) || $value instanceof Traversable );
	}
}