智能解析收货地址(PHP版本)

发现个好东东,推荐给大家:
地址:广东省深圳市南山区深南大道10000号腾讯大厦王先生13955556666

{ "code": 0, "message": "成功", "result": { "street": "深南大道10000号腾讯大厦", "full_name": "王先生", "telephone": "13955556666", "mobile": "13955556666", "province": "广东省", "city": "深圳市", "area": "南山区" } }

【智能解析收货地址(PHP版本)】PHP实现方式:
$source, 'X-Date' => $datetime, 'Authorization' => $auth, ); // 查询参数 $queryParams = array ( 'content' => '', ); // body参数(POST方法下) $bodyParams = array ( ); // url参数拼接 $url = 'https://service-6qbnpmw2-1300683954.gz.apigw.tencentcs.com/release/dizhi'; if (count($queryParams) > 0) { $url .= '?' . http_build_query($queryParams); }$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($ch, CURLOPT_HTTPHEADER, array_map(function ($v, $k) { return $k . ': ' . $v; }, array_values($headers), array_keys($headers))); if (in_array($method, array('POST', 'PUT', 'PATCH'), true)) { curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($bodyParams)); }$data = https://www.it610.com/article/curl_exec($ch); if (curl_errno($ch)) { echo"Error: " . curl_error($ch); } else { print_r($data); } curl_close($ch);

有腾讯云AK就可以用,腾讯云地址https://market.cloud.tencent.com/products/17698

    推荐阅读