$list[20][20] 1)i want to write this array as a csv how do i do it 2) how do i write a 2d array to the file
Serialize() dumps a string in "serialized PHP" format. OP needs a csv. This should do it: <? // output file name $filename = 'data.csv'; $file = fopen($filename,'w'); foreach ($list as $line) fwrite($file,implode(',',$line) . "\n"); fclose($file); ?> PHP:
He asked 2 questions, 1. how to write a CSV, 2. To write a 2d array to a file, for the latter you'd use serialize. Like I said, using fopen, for[each], fwrite & fclose.