Encode JSON:
$jsonStr = json_encode(array('MID' => $result["MID"],'email' => $email,
'name' => $username, 'address' => $address,
'phone' => $phone, 'employer' => $employer,
'insurance' => $insurance));
Set URL:
$url = "#"
Send HTTP Request:
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonStr);
curl_exec($curl);
curl_close($curl);
Decode JSON:
$data = <接收的JSON>
$json_result = json_decode($data);
$message = $json_result->message;
$id = $json_result->MID;