- fputcsv: documentation ( source)
- fclose: documentation ( source)
- fgets: documentation ( source)
- rewind: documentation ( source)
- fopen: documentation ( source)
<?php
$data = [
0 => '10BR15560R150T-5050',
28 => '72,48',
54 => '13800',
57 => '38,00'
];
$fp = fopen('php://memory', 'r+');
fputcsv($fp, [$data[0], $data[54], $data[57], $data[28] . '.jpg'], '|');
rewind($fp);
echo fgets($fp);
fclose($fp);