PHP7中文手册2018 带注释 最新chm版
header("Content-type:text/html;charset=utf-8"); function GetCurl($url){ $curl = curl_init(); curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); curl_setopt($curl,CURLOPT_URL, $url); curl_setopt($curl,CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); $resp = curl_exec($curl); curl_close($curl); return $resp; } $resp = GetCurl("远程链接"); $resp = json_decode($resp,true); header('Content-type: application/json'); echo json_encode($resp);
转载请注明:谷谷点程序 » php 如何读取(获取)远程链接的json内容