wpseek.com
WordPress开发者和主题制作者的搜索引擎
_rest_array_intersect_key_recursive › WordPress Function
Since5.3.0
已弃用n/a
› _rest_array_intersect_key_recursive ( $array1, $array2 )
| 参数: (2) |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Recursively computes the intersection of arrays using keys for comparison.
Related Functions: wp_font_library_intercept_render, get_intermediate_image_sizes, rest_parse_hex_color
源码
function _rest_array_intersect_key_recursive( $array1, $array2 ) {
$array1 = array_intersect_key( $array1, $array2 );
foreach ( $array1 as $key => $value ) {
if ( is_array( $value ) && is_array( $array2[ $key ] ) ) {
$array1[ $key ] = _rest_array_intersect_key_recursive( $value, $array2[ $key ] );
}
}
return $array1;
}