我正在写这样的CSV:
$fp= fopen('php://output', 'w');
fputs($fp, $bom =( chr(0xEF) . chr(0xBB) . chr(0xBF) ));
fputcsv($fp, array('url', 'title', 'image'), ";");
foreach ($json as $fields) {
fputcsv($fp, $fields, ";");
}
fclose($fp);
这是我文件的结果:
url;title;text;
http://mysite.it;"this is my lil' title";this is a text
这是我需要做的:
"url";"title";"text";
"http://mysite.it";"this is my title lil' title";"this is a text"
我读到fputcsv只包含一些值。如何强制双引号?