在调试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调试中使用技巧

相关文章:

  • 2021-11-02
  • 2021-09-26
  • 2022-01-03
  • 2018-05-03
  • 2021-10-25
  • 2021-10-16
  • 2021-12-03
  • 2021-10-04
猜你喜欢
  • 2021-11-21
  • 2021-10-16
  • 2021-04-11
  • 2019-01-10
  • 2021-12-27
  • 2021-11-19
  • 2021-11-23
  • 2021-08-17
相关资源
相似解决方案