Source Code:
(back to article)
<?php $fruits = ["apple", "banana"]; $key = array_search("apple", $fruits); if ($key !== false) { echo "Apple exists in the array"; } else { echo "Apple does not exist in the array"; }
Result:
Report an issue