如何在PHP中写入控制台? [英] How can I write to the console in PHP?

查看:277
本文介绍了如何在PHP中写入控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以写一个字符串或登录控制台?

Is it possible write a string or log into the console?

就像在JSP中一样,如果我们打印类似system.out.println("some")的内容,它将在控制台而不是页面上出现.

Just like in JSP, if we print something like system.out.println("some"), it will be there at the console, not at a page.

推荐答案

Firefox

在Firefox上,您可以使用名为 FirePHP 的扩展程序,该扩展程序可以记录和转储PHP应用程序中的信息到控制台.这是令人敬畏的Web开发扩展 Firebug 的附件.

On Firefox you can use an extension called FirePHP which enables the logging and dumping of information from your PHP applications to the console. This is an addon to the awesome web development extension Firebug.

Chrome

但是,如果您使用的是Chrome,则有一个名为 Chrome记录器

However if you are using Chrome there is a PHP debugging tool called Chrome Logger or webug (webug has problems with the order of logs).

最近,时钟正在积极开发中,该扩展通过向开发人员工具添加新面板来扩展开发人员工具.提供有用的调试和性能分析信息.它为 Laravel 4

More recently Clockwork is in active development which extends the Developer Tools by adding a new panel to provide useful debugging and profiling information. It provides out of the box support for Laravel 4 and Slim 2 and support can be added via its extensible API.

使用Xdebug

一种更好的调试PHP的方法是通过 Xdebug .大多数浏览器都提供帮助程序扩展,以帮助您传递所需的cookie/查询字符串以初始化调试过程.

A better way to debug your PHP would be via Xdebug. Most browsers provide helper extensions to help you pass the required cookie/query string to initialize the debugging process.

  • Chrome - Xdebug Helper
  • Firefox - The easiest Xdebug
  • Opera - Xdebug
  • Safari - Xdebug Toggler

这篇关于如何在PHP中写入控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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