独角兽企业重金招聘Python工程师标准>>>
$arrayData = array("name" => "Hagrid", "age" => "36");$sendJsonData = json_encode($arrayData);$ch = curl_init('http://127.0.0.1/jietu/test.php');curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");curl_setopt($ch, CURLOPT_POSTFIELDS, $sendJsonData);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($sendJsonData)));var_dump(curl_exec($ch));