我正在尝试从php脚本创建一个.csv文件(从数据库中获取数据)。我的问题是特殊字符无法正确显示。
$content[] = All field content at here.
echo "<pre>";
print_r($content);
$title = array("Category", "ProductName", "ProductSKU", "Price", "ProductURL", "ManufacturerSKU", "ManufacturerName","EAN","Description"
,"imageURL","StockStatus","DeliveryTime","Shippingcost");
$output = fopen('csv.csv', 'w+');
fputcsv($output, $title);
foreach ($content as $con) {
fputcsv($output, $con);
}
fclose($output);
echo "CSV created."
当我打印$ content时,它显示正常的特殊字符,但是当我打开csc.csv时,它显示不正确。