PHP Log
(1) using echo, simple output
(2) using Print_r (), can have a regular printing complex structure
(3) Var_dump recursive output of some structure
(4) print (), Simple printing
You can put the error content you want to output in the above statement or function to print output, you can also write to a file as your log log: file_put_contents ('/test1.txt ', $value [' Value '],file_append) And so on such a file function
The above is my own work in the summary of the PHP debugging method, very useful.
Remove Eclipse Warning
Add a sentence to the line where the error occurred.
@SuppressWarnings ("Unchecked")
Contains only one time
Require_once (' cmd_php4/command.php ');
Log errors
Trigger_error ("Cannot find $path", e_user_error);Using variables outside of the function
Global $mytext;
$mytext = "Nihao";
function Chao_echo () {
echo $GLOBALS [' mytext '];
}
Chao_echo ()
In PHP, there are three ways to refer to variables outside the function in a function:
1. Outside the function global declaration, the function uses the $globals array reference.
2. function within the global declaration, function within the $globals array or direct reference.
3. A parameter is passed when the function is called.
How do div align vertically?
PHP Learning Notes (ii)