Minimize your own function - it's not complicated:
function dumbcsv($file_handle, $data_array, $enclosure, $field_sep, $record_sep) { dumbescape(false, $enclosure); $data_array=array_map('dumbescape',$data_array); return fputs($file_handle, $enclosure . implode($enclosure . $field_sep . $enclosure, $data_array) . $enclosure . $record_sep); } function dumbescape($in, $enclosure=false) { static $enc; if ($enclosure===false) { return str_replace($enc, '\\' . $enc, $in); } $enc=$enclosure; }
(the above uses unix-style erasure)
FROM.
symcbean
source share