4
4

1 回答 1

9

我猜你错过了选项CURLOPT_ENCODING

请尝试以下代码。

$ch = curl_init('http://example.com/?api=**');
curl_setopt($ch, CURLOPT_HTTPHEADER, 'text/plain;charset=UTF-8');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
$results = curl_exec($ch);
var_dump($results);
于 2013-01-24T17:51:52.077 回答