輸出前添加 <pre>,便可以自動格式化換行顯示。
print_r("<pre>");
比如打印數組 : print_r($arr);
輸出:
Array ( [0] => Array ( [volume] => id100343 [weight] => 4 ) [1] => Array ( [volume] => id100212 [weight] => 1 ) [2] => Array ( [volume] => id104104 [weight] => 10 ) )
添加<pre> 后,看起來就清晰很多
print_r("<pre>");
print_r($arr);
輸出:
Array
(
[0] => Array
(
[volume] => id100343
[weight] => 4
)
[1] => Array
(
[volume] => id100212
[weight] => 1
)
[2] => Array
(
[volume] => id104104
[weight] => 10
)
)
————————————————