您的位置:首頁技術文章
文章詳情頁

為什么返回值為空?哪里錯了,麻煩大佬幫忙改改,謝謝。

瀏覽:112日期:2022-06-05 10:56:55

問題描述

<?phpinclude "wechat.class.php";function getda($w){$r=file_get_content("http://api.lyoo.xyz/xiaochengxu/chati.php?w=".$w);$s=json_decode($r,true);if($s['code']==200){$tm=$s['tm'];$da=$s['da'];return ":$tm"."n".":$da"."n".;}else{return $s['msg'];}}

求大佬幫忙看看

問題解答

回答1:

你這個api返回的不是json ,那么你拿到數據 后再用json_decode就肯定是空值 了

国产综合久久一区二区三区