- file_get_contents: documentation ( source)
- var_dump: documentation ( source)
<?php
$a = new arrayObject(array(1, 2, 'd', "1,3"));
$file = new splfileobject('/tmp/stdfile.txt', 'w+');
$file->fputcsv($a);
var_dump(file_get_contents('/tmp/stdfile.txt'));