Answers for "how to find a key exist in artray in php"

PHP
22

php key in array exists

<?php
$search_array = array('first' => null, 'second' => 4);

// returns false
isset($search_array['first']);

// returns true
array_key_exists('first', $search_array);
?>
Posted by: Guest on June-07-2020
0

array_key_exists

<?php
$search_array = array('first' => null, 'second' => 4);

// returns false
isset($search_array['first']);

// returns true
array_key_exists('first', $search_array);
?>
Posted by: Guest on April-10-2022

Code answers related to "how to find a key exist in artray in php"

Browse Popular Code Answers by Language