3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row_before = ['A', json_encode(['a', '\\', 'b']), 'B']; print "\nBEFORE:\n"; var_export($row_before); print "\n"; $fh = fopen($file = 'php://temp', 'rb+'); fputcsv($fh, $row_before, ',', '"', "\0"); rewind($fh); $row_after = fgetcsv($fh); print "\nAFTER:\n"; var_export($row_after); print "\n\n"; fclose($fh);

preferences:
25.1 ms | 410 KiB | 5 Q