$html = file_get_contents($url); $html = str_replace(' ','',$html); $userInfo = json_decode($html,true);html
緣由:接口還回的數據自動在頭部加上了BOM頭,致使轉換失敗。 解決方案:$html = str_replace(' ','',$html);json