note 105409 added to function.print-r

From: Date: Tue, 16 Aug 2011 05:18:22 +0000
Subject: note 105409 added to function.print-r
Groups: php.notes 
Request: Send a blank email to php-notes+get-182502@lists.php.net to get a copy of this message
this is the function to print_r to a file function print2file($arr, $file){ $fp = fopen($file, "a"); if(is_array($arr)){ fputs($fp, "Array( "); foreach($arr as $key => $val){ fputs($fp, "[".$key."]"." => ".$val." "); } fputs($fp, " )\n"); } else { fputs($fp, $arr."\n"); } fclose($fp); } this function can show values of data also echo and print_r of the variables Regards, ---- Server IP: 69.147.83.197 Probable Submitter: 119.46.161.198 ---- Manual Page -- http://www.php.net/manual/en/function.print-r.php Edit -- https://master.php.net/note/edit/105409 Del: integrated -- https://master.php.net/note/delete/105409/integrated Del: useless -- https://master.php.net/note/delete/105409/useless Del: bad code -- https://master.php.net/note/delete/105409/bad+code Del: spam -- https://master.php.net/note/delete/105409/spam Del: non-english -- https://master.php.net/note/delete/105409/non-english Del: in docs -- https://master.php.net/note/delete/105409/in+docs Del: other reasons-- https://master.php.net/note/delete/105409 Reject -- https://master.php.net/note/reject/105409 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#182502) next »