📜  检查数组在 php 代码示例中有键

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

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

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