- fputcsv: documentation ( source)
- fclose: documentation ( source)
- fgets: documentation ( source)
- rewind: documentation ( source)
- fopen: documentation ( source)
<?php
$data = array(
'lala'
);
$buffer = fopen('php://temp', 'r+');
fputcsv($buffer, $data, ',', '');
rewind($buffer);
$csv = fgets($buffer);
fclose($buffer);