Answers for "if key contains 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
1

php check if object has key

if (property_exists($ob, 'a'))
Posted by: Guest on September-10-2021

Browse Popular Code Answers by Language