Mega Code Archive
Categories
/
Php
/
Data Type
Testing for the Existence of a Key in an Array
'German', 'France' => 'French', 'Spain' => 'Spanish'); $country = 'asdf'; printf("
%s of our visitors are from %s.
\n", array_key_exists($country, $countries) ? 'Some' : 'None', $country); ?>