您的位置:首页技术文章
文章详情页

为什么返回值为空?哪里错了,麻烦大佬帮忙改改,谢谢。

【字号: 日期:2022-06-05 10:56:55浏览:63作者:猪猪

问题描述

<?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就肯定是空值 了