JS-like Console.log (); You can add and then watch the console log debug in the PHP code line, which does not affect the normal program run.
Reply content:
JS-like Console.log (); You can add and then watch the console log debug in the PHP code line, which does not affect the normal program run.
Refer to an external PHP file chromephp
How to use:
include 'ChromePhp.php';ChromePhp::log('Hello console!');ChromePhp::log($_SERVER);ChromePhp::warn('something went wrong!');
This will enable you to see the information in the Chrome browser console. It's not been tested on Firefox.
First of all, JavaScript in the browser environment is resolvable, and PHP can not, must have a parser such as apache,php-cgi, so you want PHP in the browser control operation is not realistic.
In peacetime debugging can use echo, print_r, var_dump
such functions to output the results to the page,
Of course you can also follow the Xdebug debugging tool to support breakpoint debugging
I said the way I used to dubug:
file_put_contents('log.txt',var_export($_POST,true));//这样不会中断程序的运行
Https://craig.is/writing/chrome-logger
Yes, monolog with chromephp extension