How to print array contents into a log file in magento CE 1.7 without iterating through a loop?
Magento 1.7 Log – How to Print Array Contents in Log File
arraylogmagento-1.7
arraylogmagento-1.7
How to print array contents into a log file in magento CE 1.7 without iterating through a loop?
Best Answer
Adding a second parameter to print_r will return a string with printed variable.
[EDIT]
based on the comments below I feel obligated to offer other options for logging an array.
or if you need a string prefix to the array
The second parameter of
Zend_Debug::dump()
is a label. If this is notnull
it will be added to before the array dump.The third parameter of
Zend_Debug::dump()
meansecho
. If it'strue
then the dump result will be echoed, if it'sfalse
it will be returned as a string. In your case you need it to befalse
.