Which is the most efficient way to determine if a key is present in an array, assuming the array has no NULL values?

Posted by: Pdfprep Category: 200-710 Tags: , ,

Which is the most efficient way to determine if a key is present in an array, assuming the array has no NULL values?
A . in_array(‘key’, array_keys($a))
B . isset($a[‘key’])
C . array_key_exists(‘key’, $a)
D . None of the above

Answer: B

Leave a Reply

Your email address will not be published.