php-Arrays函数-array_diff_key-使用键名比较计算数组的差值
array_diff_key() 函数 使用键名比较计算数组的差集
【功能】
该函数将返回一个数组,
该数组包含了所有在array1中但是不在其他任何参数数组中的键名的值。
【使用范围】
>=5.1.0
【使用】
array array_diff_key( array array1, array array2[,array...] )
array1/必需/数组1
array2/必需/比较的数组 最少得有一个
array.../可选/用来比较的数组
【示例】
[php]
$arr1 = array( "key1" => "val1", "key2" => "val2" );
$arr2 = array( "key1" => "val1", "key3" => "val2" );
$arr3 = array( "key2" => "val2" );
print_r( array_diff_key( $arr1, $arr2 ) );
print_r( array_diff_key( $arr1, $arr3 ) );
print_r( array_diff_key( $arr1, $arr2, $arr3 ) );
/*
Array
(
[key2] => val2
)
Array
(
[key1] => val1
)
Array
(
)
*/
摘自 zuodefeng的笔记

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
