文章詳情頁
為什么返回值為空?哪里錯了,麻煩大佬幫忙改改,謝謝。
瀏覽:95日期: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就肯定是空值 了
排行榜
![css3 - [CSS] 動畫效果 3D翻轉bug](http://www.aoyou183.cn/attached/image/news/202304/110831f073.png)