$html = file_get_contents($url); $html = str_replace(' ','',$html); $userInfo = json_decode($html,true);html
缘由:接口还回的数据自动在头部加上了BOM头,致使转换失败。 解决方案:$html = str_replace(' ','',$html);json