Checks if the specified key is in the array
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
    echo "The 'first' element is in the array";
}
by Valeri Tandilashvili
4 years ago
PHP
functions
2
Pro tip: use ```triple backticks around text``` to write in code fences