我在谷歌和这里搜索过很多但我没有进一步解决我的问题。 我不是编码器,虽然我试图解析JSON到PHP变量,但我得到一个空响应,我想要一个表显示或至少任何jsondata p>
这是什么 我的代码如下所示: p>
<!DOCTYPE html>
< html>
< body>
< h1>可用代理< / h1> \ n
<?php
$ url ='https:// url / livewebservice / imoscontactagentstate?用户名=用户名& Pwd =密码& Cmd = GetState& ResultType = JSON';
//启动curl
$ ch = curl_init($ url);
$ data = json_encode($ data,true);
ncurl_setopt($ ch,CURLOPT_CUSTOMREQUEST,“POST”);
curl_setopt($ ch,CURLOPT_POSTFIELDS,$ data);
curl_setopt($ ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ ch,CURLOPT_HTTPHEADER,array(
'Content-Type:application / x-www-form-urlencoded',
'charset = utf-8')
); \ n $ result = curl_exec($ ch);
curl_close($ ch);
return $ result;
var_dump(json_decode($ result,true));
print_r($ result);
Nacach($ result as $ key => $ value)
{
echo'< td>< font face =“calibri”color =“red”>'。$ value [type]。' < / font>< / td>< td>< font face =“calibri”color =“blue”>'。$ value [category]。' < / font>< / td>< td>< font face =“calibri”color =“green”>'。$ value [amount]。' < / font>< / tr>< tr>';
}
echo“< / tr>< / table>”;
?>
< / body>
< / html>
code> pre>
我很感激任何提示 p>
div>