Source Code:
(back to article)
<?php $array = array('first_name' => 'John', 'last_name' => 'Doe'); if (array_key_exists('first_name', $array)) { echo "The key 'first_name' exists in the array."; } else { echo "The key 'first_name' does not exist in the array."; } ?>
Result:
Report an issue