1. Direct output to the browser with Echo, print, Print_r, Var_export, or Var_dump
This situation does not appear in the middle of the page break and jump, usually followed by exit.
After the project is officially launched, these debugging code is removed or annotated, if not removed, it will appear too much garbage code, performance may be a little bit of a problem.
2. Write the value of the variable you want to output to a file
This is typically done with a PHP network function to implement a socket link, such as any connection made through fopen (), Fsockopen (), and Pfsockopen ().
The most appropriate way to do this is if the request is not from the browser, but from the client software (Appendix L. List of supported protocols/wrappers), especially in the development debugging phase, if there is no log, the program is almost impossible to debug (because the program is called by the client, there is no interface, This is not the way to debug with Echo
For example, Ucenter integrates a third-party PHP application, Ucenter connects to multiple applications, and we just need to write the $get variable in a third-party PHP application uc.php and then read the file to know the Ucenter that Action,id sends to each app.
PHP writes an array to a file
$file = "./data/log.txt";
$array = Array ("Count" = "3000″", "num" = "300″");
File_put_contents ($file, serialize ($array));//write Cache
?>
Author "Danbaise"
http://www.bkjia.com/PHPjc/478643.html www.bkjia.com true http://www.bkjia.com/PHPjc/478643.html techarticle 1. Direct output to the browser with Echo, print, Print_r, Var_export, or var_dump This situation does not appear in the middle of the page interrupt and jumps, generally followed by exit. After the project is officially launched ...