我有来自angular的数据表,我想将其转换为sting以放入表sql数据库......
使用该代码的Normaly我能够解析所有内容,但它为该URL返回零...
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $URL);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36');
$querymain = curl_exec($curl_handle);
curl_close($curl_handle);
$arr = json_decode((string)$querymain, true);
(json_last_error()); // call after json_decode
$numarr = count($arr['data']);
感谢您的提示。