WordPress开发者和主题制作者的搜索引擎



is_iterable ›

Since4.9.6
已弃用n/a
is_iterable ( $var )
参数:
  • (mixed) $var The value to check.
    Required: Yes
返回:
  • (bool) True if `$var` is iterable, false otherwise.
定义在:
文档:

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.



源码

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