09-06-2007, 03:46 PM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 713
Thanks: 2
|
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($aArray, true), 3, 'debug.log');
|
|
|
|