PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table userAgent ( id int auto_increment primary key, target varchar(20) not null, agent varchar(2000) ); INSERT INTO userAgent (id, target, agent) VALUES (1, 'MOB', 'Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G970F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/15.0 Chrome/90.0.4430.210 Mobile Safari/537.36'); INSERT INTO userAgent (id, target, agent) VALUES (2, 'WEB', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36'); select * from userAgent ;
Copy Clear
Copy Format Clear
<?php $answer ='"{"status":"error","code":143,"message":"User already exist"}'; $obj = json_decode($answer); $status = $obj->{'status'}; $code = $obj->{'code'}; $message = $json['message']; echo $status; $result = array( 'status' => $status, 'location' => $location, 'message' => $message, 'code' => $code ); echo json_encode($result);
Show:  
Copy Clear