如何学习PHP array_diff_key
定义和用法
array_diff_key() 函数返回一个数组,该数组包括了所有在被比较的数组中,但是不在任何其他参数数组中的键。
语法
array_diff_key(array1,array2,array3...)
参数
描述
array1必需。与其他数组进行比较的第一个数组。
array2必需。与第一个数组进行比较的数组。
array3可选。与第一个数组进行比较的数组。可以有多个。
提示和注释
提示:可用一个或任意多个数组与第一个数组进行比较。
注释:仅仅键名用于比较。
例子
"Cat",1=>"Dog",2=>"Horse"); $a2=array(2=>"Bird",3=>"Rat",4=>"Fish"); $a3=array(5=>"Horse",6=>"Dog",7=>"Bird"); print_r(array_diff_key($a1,$a2,$a3)); ?>
输出:
Array ( [0] => Cat [1] => Dog )

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

SublimeText3 Chinese version
Chinese version, very easy to use

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

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

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

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