search

Home  >  Q&A  >  body text

Why is the return value empty? What's wrong? Could you please help me correct it? Thank you.

<?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']; }}

Please help me, please

手机用户1589615777手机用户15896157771743 days ago1455

reply all(1)I'll reply

  • 秋香姐家的小书童

    秋香姐家的小书童2020-05-18 08:34:27

    What your api returns is not json, then if you use json_decode after getting the data, it will definitely be a null value

    reply
    0
  • Cancelreply