how to check if key is present in json in php 1

how to check if key is present in json in php

if( isset( $mydata['user_id'] ) ){
   // do something
}

Here is what the above code is Doing:
1. We’re checking if the user_id key exists in the $mydata array.
2. If it does, we’re going to do something.

Similar Posts