Why is my debug data unformatted?

╄→гoц情女王★ 提交于 2019-12-21 18:47:31

问题


var_dump and print_r are displayed are not formatted when using Laravel 4. How do I format the data to be more readable?


回答1:


Add Kint to your composer.json by running this on the command line:

composer require raveren/kint "dev-master"

And then try it:

dd( new Controller );

You should see this:

Better, huh?




回答2:


Use kint

we use should s() instead of print_r()

use should d() instead of var_dump()

ex: sd($arr); like same print_r($arr); die();

Ref: http://raveren.github.io/kint/#configuration




回答3:


You can use the pre tag to format align your answear http://www.w3schools.com/tags/tag_pre.asp



来源:https://stackoverflow.com/questions/17009465/why-is-my-debug-data-unformatted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!