Answers for "check if key exists in json object php"

PHP
1

if don't exist key json php

<?php
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
    echo "The 'first' element is in the array";
}
?>
Posted by: Guest on February-24-2020
0

how to check if key is present in json in php

if( isset( $mydata['user_id'] ) ){
   // do something
}
Posted by: Guest on September-24-2020

Code answers related to "check if key exists in json object php"

Browse Popular Code Answers by Language