php array to file

Now you can easily store multidimensional array into file.There is some sitution when you need to store multidimensional array into file.For example you want to debug some output (Example IPN).There is no way to debug ipn so you want to write post variable or other variable to file then you can store this array to file directly.



'0'=>'test 0',
'1'=>'test 1',
'2'=>'test 2',
'3'=>'test 3'

print_r( $yourArry);
$output = ob_get_clean();
file_put_contents( 'yourfilename.txt',$output );