PHP脚本中Mysql到CSV的特殊字符问题

时间:2015-02-26 09:27:58

标签: php

我正在尝试从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时,它显示不正确。

0 个答案:

没有答案