So überprüfen Sie, ob der Schlüssel in JSON in PHP vorhanden ist

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