Source Code:
(back to article)
<?php $students = [ "John" => ["age" => 20, "marks" => 90], "Mary" => ["age" => 21, "marks" => 95], "Bob" => ["age" => 19, "marks" => 85], ]; if (array_key_exists("John", $students)) { echo "Key exists!"; } else { echo "Key does not exist!"; } ?>
Result:
Report an issue