接口数据api
接口平台:https://api.yuanfenju.com/
开发文档:https://doc.yuanfenju.com/liupan/qimendunjia.html
支持格式:JSON
请求方式:HTTP POST
<?php
//您的密钥
$api_secret = "wD******XhOUW******pvr";
//请求择日择时接口
$gateway_host_url = "https://doc.yuanfenju.com/liupan/qimendunjia.html";
//请求参数
$request_data = [
'name' => $api_secret,
'sex' => '0',
'type' => '0',
'year' => '1999',
'month' => '12',
'day' => '3',
'hours' => '12',
'minute' => '3',
];
//curl
function curlSend($process_gateway, $data_arr, $type = 1) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $process_gateway);
curl_setopt($ch, CURLOPT_POST, $type);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data_arr));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_FAILONERROR, true); // Set this option to handle errors
$response = curl_exec($ch);
if ($response === false) {
$error_message = curl_error($ch);
// Handle or output the error message as needed
echo "cURL error: " . $error_message;
}
curl_close($ch);
return $response;
}
function process_host($curlPost,$gateway_url) {
$response = curlSend($gateway_