note 105409 deleted from function.print-r by danbrown
| From: | danbrown@php.net | Date: | Wed, 17 Aug 2011 15:38:42 +0000 |
| Subject: | note 105409 deleted from function.print-r by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182542@lists.php.net to get a copy of this message | ||
Note Submitter: SuperMaN
----
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,