我用这段代码获取数据
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en'r'n" .
"Cookie: foo=bar'r'n"
)
);
$context = stream_context_create($opts);
$content = file_get_contents('http://tr.betboo672.com/services/InPlayApp.mvc/GetInPlaySports?isShrinked=false', false,
$context);
echo $content;
有时是问题字符集编码。它不稳定(更改每个刷新页面的字符编码)。有时获取此数据
���`I�%&/m�{J�J��t��`$ؐ@�������iG#)�*��eVe]f@�흼��{����{����;�N'���?'fdl��J�ɞ!���?
mb_detect_encoding函数始终返回 UTF-8我试过这个检测编码并使所有内容都为 UTF-8
您的页面编码是否设置为 utf8?
header('Content-Type: text/html; charset=utf-8');