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;
}
正如您在上面看到的那样,我上传文件然后再次将其吐出没有问题......但我需要将特殊字符(如重音字符和破折号)转换为等效或 HTML 版本。我该怎么做?
Windows 7、Apache 2.2.21、PHP 5.4.3、CakePHP 1.3