Echo ()
Multiple values can be output at one time, and multiple values are separated by commas. Echo is a language structure (language construct), not a real function and therefore cannot be used as part of an expression.
Print ()
The function print () prints a value (its arguments) and returns True if the string is successfully displayed, otherwise false.
Print_r ()
You can simply print the string and the number, and the array is displayed with the enclosed key and the list of merits, starting with an array. However, the result of Print_r () output Boolean and null is meaningless because it is all printed "\ n". Therefore, using the Var_dump () function is more suitable for debugging.
Var_dump ()
Determine the type and length of a variable, and output the value of the variable if the variable has a value for the variable and the return data type. This function displays structure information about one or more expressions, including the type and value of the expression. The array recursively expands the value and displays its structure by indentation.
Look at the code below form1.php
formprocess1.php
The result of using the echo output is:
Hello!Degug: Array
The result of using the print () output is:
Hello!Degug: Array
The result of using the Print_r () output is:
Hello!Degug: Array ( [name] + [Submit] = submit)
The result of using the Var_dump () output is:
Hello!degug:Array (2) { ["name"]=> string (0) "" ["Submit"]=> string (6) "Submit"}
We can see that the var_dump () output is the most informative, so use this function frequently to debug the program.
Tyler Ning
Source: http://www.cnblogs.com/tylerdonet/
This article is copyright to the author and the blog Garden, welcome reprint, but without the consent of the author must retain this paragraph of the statement, and in the article page obvious location to the original connection, if there is a problem, you can contact me through the following email address [email protected] , thank you very much.
The difference between the output string in PHP (Echo,print,printf,print_r and Var_dump) "reprint"