if(!empty($_FILES['csv'])){
$this->autoRender = false;
$text = file_get_contents($_FILES['csv']['tmp_name']);
header('Content-type: application/CSV');
header('Content-Disposition: attachment;filename=' . $_FILES['csv']['name']);
echo $text;
return;
}
我沒有問題,上傳文件,然後再出來,你可以在上面看到隨地吐痰回來......但我需要特殊字符轉換像重音字符和EM - 進入等效或HTML版本。我該怎麼做?PHP:上傳CSV和轉換特殊字符爲HTML
Windows 7中的Apache 2.2.21,PHP 5.4.3,CakePHP的1.3
最終使用此(有點髒)功能發現在http://alanwhipple.com/2011/06/04/php-clean-encoding-issues-smart-curly-quotes-em-dashs/ – azBrian