I sometimes prefer to use
header("Content-type: text/plain");
Do not mess around with HTML. However, whenever an error occurs, or when I use var_dump()
, it would issue a large HTML block to prettify the output. While it's great in HTML context, I would like to disable it when I work in text/plain.
Is it possible to do? Runtime disable of the prettify?
XDebug will show you an error if PHP HTML errors are enabled. You can do one of the following
You can disable php errors from displayed.
ini_set('display_errors', 0)
Or you can change
html_errors = On
setting of php.ini for xdebug tohtml_errors = Off'
ini_set('html_errors', 'off')
But you should know, you cannot prevent PARSE errors from appearing using ini_set()
.
来源:https://stackoverflow.com/questions/18714241/how-to-runtime-disable-xdebugs-var-dump-and-errors-prettify