Consider these 2 examples...
$key = 'jim';
// example 1
if (isset($array[$key])) {
// ...
}
// example 2
if (array_key_exists($key, $array)) {
// ...
}
I'm interested in knowing if either of these are better. I've always used the first, but have seen a lot of people use the second example on this site.
So, which is better? Faster? Clearer intent?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…