1

我正在使用以下方法从 url 获取 JSON。当我在 php shell 中输出 json 时它可以工作,但在网站上,输出被截断。有没有解释。这是我要检索的网址:http ://energylens.sfsprod.is4server.com:8080/proc/slope_intercept_tester

function get($url){     
  $curl_handle=curl_init();           
  curl_setopt($curl_handle,CURLOPT_URL,$url);     
  curl_setopt($curl_handle,CURLOPT_HTTPGET,1);     
  curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,0);          
  curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);          
  $reply = curl_exec($curl_handle);     
  curl_close($curl_handle);                                                               
  return $reply;                                             
}    

这是我截断的输出:

值-p1.value)/(p2.ts-p1.ts); } return '错误:未定义的数据点参数'; }; state.intercept = function(slope,p1){ if(typeof p1 != 'undefined' && typeof p1.value != 'undefined' && typeof p1.ts != 'undefined'){ return p1.value - (slope* p1.ts); } return '错误:未定义的数据点参数'; }; } if(typeof state.multibuf == 'undefined'){ state.multibuf = new Object(); } outObj.inputs = new Array(); 变量注释=新对象();for(i=0; i=2){ for(j=0; j 未定义的数据点参数'; }; } if(typeof state.multibuf == 'undefined'){ state.multibuf = new Object(); } outObj.inputs = new Array(); 变量注释=新对象();for(i=0; i=2){ for(j=0; j 未定义的数据点参数'; }; } if(typeof state.multibuf == 'undefined'){ state.multibuf = new Object(); } outObj.inputs = new Array(); 变量注释=新对象();for(i=0; i=2){ for(j=0; j

4

1 回答 1

1

那是一个带有 Javascript 的 JSON,你用 php json_decode 解码了 JSON 吗?

查看浏览器源文件,它可能都在那里,但被浏览器隐藏了。

于 2012-11-09T19:20:11.540 回答