The best I found yet is this:
echo "";
print_r($arr);
echo "
";
And if you want it more detailed:
echo "";
var_dump($arr);
echo "
";
Adding a HTML tag in a web development environment will respect the newlines \n of the print function correctly, without having to add some html