Source Code:
(back to article)
<?php $fruits = ["apple" => 1, "banana" => 2, "orange" => 3]; if (array_key_exists("apple", $fruits)) { echo "The value of apple is " . $fruits["apple"]; } else { echo "Key does not exist!"; } ?>
Result:
Report an issue