Page 1 of 1

print_r() not working properly?

Posted: Sun May 07, 2006 12:49 pm
by HiddenS3crets
When I use print_r() to display an array, it does not put in the proper line breaks and indents like it should. Instead it is all on one line like:
Array( [0] => 'hi' [1] => 'bye' );

How can I make it so it's like:
Array
(
[0] => 'hi'
[1] => 'bye'
)

Posted: Sun May 07, 2006 12:51 pm
by s.dot

Code: Select all

echo '<pre>';
print_r($array);
echo '</pre>';

Posted: Sun May 07, 2006 12:52 pm
by Oren
Hint: You may want to check the source code :idea:

EDIT: scottayy was faster than me (1 min) and gave you the solution :P