View Single Post
Old 09-06-2007, 02:46 PM   #2 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

As of PHP 4.3.0, there is an optional second parameter to the print_r function which is a boolean dictating whether the output from print_r is actually output (default) or returned as a string.

Your example can be therefore slightly altered to something more like:
PHP Code:
$aArray = array('one''two''three''four');
// Return print_r output, log to custom log file debug.log
error_log(print_r($aArraytrue), 3'debug.log'); 
Salathe is offline  
Reply With Quote