📜  数组中的 php 键存在 - PHP 代码示例

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

代码示例3
 10,
    'key2' => 20,
    'key3' => 30,
    'key4' => 40,
);

if (count(array_intersect_key(array_flip($required), $data)) === count($required)) {
    // All required keys exist!
}