is a command and cannot return a value. Echo can be followed by many parameters, separated by semicolons, such as:
echo $myvar 1;
Echo 1,2, $myvar, "bold";
-Print
is a function that can return a value and can have only one argument.
-printf
function, format the text after the output, such as:
$name = "Hunte";
$age = 25;
printf ("My name was%s, age%d", $name, $age);
-sprintf
Similar to printf, but does not print, but returns the formatted text, the rest is the same as printf.
-Echo
is a command and cannot return a value. Echo can be followed by many parameters, separated by semicolons, such as:
echo $myvar 1;
Echo 1,2, $myvar, "bold";
-Print
is a function that can return a value and can have only one argument.
-printf
function, format the text after the output, such as:
$name = "Hunte";
$age = 25;
printf ("My name was%s, age%d", $name, $age);
-sprintf
Similar to printf, but does not print, but returns the formatted text, the rest is the same as printf.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.