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



wp_is_numeric_array › WordPress Function

Since4.4.0
已弃用n/a
wp_is_numeric_array ( $data )
参数:
  • (mixed) $data Variable to check.
    Required: Yes
返回:
  • (bool) Whether the variable is a list.
定义在:
文档:

Determines if the variable is a numeric-indexed array.



源码

function wp_is_numeric_array( $data ) {
	if ( ! is_array( $data ) ) {
		return false;
	}

	$keys        = array_keys( $data );
	$string_keys = array_filter( $keys, 'is_string' );

	return count( $string_keys ) === 0;
}