天天看點

PHP開發中,讓var_dump調試函數輸出更美觀 ^_^#

最近開發發現自己電腦var_dump時候沒有如下效果。

果斷google、百度下。

^_^#

抱歉,沒有找到結果。

就小小的機智了下,右鍵檢視源碼,答案有了。

是xdebug帶來的福利。

添加xdebug方法如下:

根據自己的PHP版本去下載下傳一個php_xdebug.dll檔案。

找到php.ini檔案。

在末尾添加如下:

1

2

3

4

5

6

7

8

9

10

11

12

<code>; XDEBUG Extension</code>

<code>zend_extension =</code><code>"D:/wamp/bin/php/php5.3.27/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"</code>

<code>[xdebug]</code>

<code>xdebug.remote_enable = on</code>

<code>xdebug.remote_handler = dbgp</code>

<code>xdebug.remote_host = localhost</code>

<code>xdebug.remote_port = 9001</code>

<code>xdebug.profiler_enable = off</code>

<code>xdebug.profiler_enable_trigger = off</code>

<code>xdebug.profiler_output_name = cachegrind.out.%t.%p</code>

<code>xdebug.profiler_output_dir =</code><code>"D:/wamp/tmp"</code>

 重新開機apache服務。

好了,小夥伴們,happy的去玩var_dump吧!