$user_id, 'Timestamp' => $timestamp, 'Name' => $name, 'Phone' => $phone, 'IDCard' => $idcard, 'Province' => $province, 'City' => $city, 'Area' => $area, 'Address' => $address, 'ProductID' => $product_id, 'DownOrderID' => $down_order_id, 'ThirdPhone' => $third_phone, 'user_sign' => $user_sign.$secret ); $json_data = json_encode($post_data); echo $json_data; // 提交请求 // $url = "https://haokaopenapi.lot-ml.com/api/order/ApiToOrder"; // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_POST, 1); // curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); // $output = curl_exec($ch); // curl_close($ch); // 解析返回结果 $result = json_decode($output, true); if ($result['code'] == 0) { echo "下单成功,订单号:" . $result['message']; } else { echo "下单失败,错误信息:" . $result['message']; } ?>