在调试php程序我们经常会打印信息来查看,print_r函数可以非常方便打印数组内容,但打印出来没有按照格式缩进显示,看起来非常不方便。

现在有个小技巧,就是用pre标签,如:

<pre><?php print_r($tempArr)?></pre>  

举例代码:

<?php
$tempArr=array('a'=>1,'b'=>2,'c'=>array(1,2,3));
?>
<pre><?php print_r($tempArr)?></pre>

页面显示如下:

html标签pre在php调试中使用技巧

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2021-11-23
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
猜你喜欢
  • 2021-11-16
  • 2021-08-04
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案