- var_dump: documentation ( source)
- rtrim: documentation ( source)
- fputcsv: documentation ( source)
- stream_get_contents: documentation ( source)
- fclose: documentation ( source)
- rewind: documentation ( source)
- fopen: documentation ( source)
<?php
$array = array('a"b', 'a\\"b');
$file = fopen('php://memory', 'w+');
fputcsv($file, $array);
rewind($file);
var_dump(rtrim(stream_get_contents($file)));
fclose($file);