📜  array_key_exists 与 in_array - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:29.050000             🧑  作者: Mango

代码示例1
in_array() v/s array_key_exists()
Difference:

in_array() checks if a value exists in an array (checks the values, not the keys) and returns true, or false otherwise.
while:

array_key_exists() checks if the given key or index exists in the array (checks in keys, not in values) and returns true, or false otherwise.
Visits the manual (links above) for examples and more information.