ECHO is a PHP statement, print and Print_r are functions, the statement does not return a value, the function can have a return value (even if it is not used)
Print only prints out values for simple type variables (such as int,string)
Print_r can print out values for complex type variables (such as arrays, objects)
echo--output one or more strings
Description
void Echo (String arg1 [, String ...])//return value is empty
echo "Hello", "friend";
Print-Output a string
Description
int print (string arg)//return value is reshape
print "Hello friend";
You can do the following
$name =print "Nihao \ n";
$STR = ' Test print value is $name. ';
Eval ("$print =\" $str \ ";");
Echo $print;
Print_r-Print easy-to-understand information about variables.
BOOL Print_r (mixed expression [, bool return])//Return value is Boolean, parameter is mix type, can be string, shape, array, object class Print_r () display easy-to-understand information about a variable. If a string, integer, or float is given, the variable value itself is printed. If an array is given, the keys and elements are displayed in a certain format. object is similar to an array.
Print_r () Moves the pointer of the array to the last edge.
You can
Print_r (str);
Print_r (int);
Print_r (array);
Print_r (obj);
You can also use Var_dump Var_export
http://www.bkjia.com/PHPjc/317113.html www.bkjia.com true http://www.bkjia.com/PHPjc/317113.html techarticle Echo is a PHP statement, print and Print_r is a function, the statement does not return a value, the function can have a return value (even if it is not) print only the value of a simple type variable (such as int,string) Print_r can print ...