PHP调试回声的 [英] PHP Debug Echo's

查看:92
本文介绍了PHP调试回声的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道 -

调试PHP时 - 您希望输出测试数据以查看发生的情况?我已经注意到我的很多PHP回声测试都是用CSS来修复的。有没有人有一个很好的干净的方法来观察结果,而不用与站点本身相关?

When debuging PHP - how do you like to output the test data to see whats going on? I've been noticing that alot of my PHP echo testing is screwing with my CSS. Does anyone have a good clean method of seeing the results without screwing with the site itself?

推荐答案

你应该尝试error_log 功能。它会将调试输出直接记录到Web服务器日志中,而不是在您的页面中。

You should try error_log function. It will log your debug output directly into the web server logs, and not in your page.

另一种方法是在注释标记之间进行回应:

Another way is to echo between comments markups:

echo '<!-- This is a debug message! -->';

这篇关于PHP调试回声的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆