1
我使用cURL
來提交表單,並使用PHP的http_build_query()
來形成查詢字符串。我想知道爲什麼表單沒有提交,然後我回應查詢字符串只查詢查詢字符串中的'¶'和'ð`。http_build_query在查詢字符串中輸入奇怪的字符
$post_data = array('terms' => 'true',
'ethnicity' => 0,
'param0' => 'Lance',
'param1' => 'Newman');
$post_data = http_build_query($post_data);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
echo $post_data;
返回
terms=trueðnicity=0¶m0=Lance¶m1=Newman
我試圖把
header('Content-Type: text/html; charset=utf-8');
在頁面的頂部,沒有運氣
php文件它也保存爲UTF8? – tttony 2014-08-31 07:50:56