Table of contents Home page
$a = array('one' => 1, 'two' => 2, 'three' > 3); $k = 'two'; echo "The key '$k' ", (key_exists($k, $a) ? 'exists' : 'does not exist'), ' in the array.', "\n"; $k = 'four'; echo "The key '$k' ", (key_exists($k, $a) ? 'exists' : 'does not exist'), ' in the array.', "\n";