<?php
/*
* The value of the $escape parameter doesn't matter
* unless it's set to the one character that makes sense
* then it f's up the escaping and produces invalid CSV data
*
*/
$fh = fopen('php://stdout', 'w');
fputcsv($fh, ['using default', 'a,"b'], ',', '"');
fputcsv($fh, ['using " ', 'a,"b'], ',', '"', '"');
fputcsv($fh, ['using x ', 'a,"b'], ',', '"', 'x');
fputcsv($fh, ['using \\ ', 'a,"b'], ',', '"', '\\');