Echo and print statements, and echoprint statements. Echo and print statements, echoprint statements in php, there are two basic output methods: echo and printecho and print differences: echo can output more than one string, no echo or print statements are returned.
In php, there are two basic output methods: echo and print
Differences between echo and print:
- Echo -- can output more than one string without returning a value
- Print -- only one string can be output, and the return value is always 1
Echo statement:
Echo is a language structure and can be used with or without parentheses: echo or echo ();
For example:
Display string:
Echo "PHP is fun! ";
Echo "Hello world! ";
Echo "plan", "learning", "PHP ";
?>
Display variables:
$ Txt1 = "Learn PHP ";
$ Txt2 = "***. com ";
$ Cars = array ("Volvo", "BWM", "AABB ");
Echo $ txt1;
Echo"
";
Echo "Study PHP at $ txt2 ";
Echo"
";
Echo "my car is a {$ cars [0]}";
?>
Print statement:
Print is also a language structure, and can be used with or without parentheses: print or print ();
Display string:
Print "PHP is fun! ";
Print "" Hello world!
";
Print "I'm about to learn PHP! ";
?>
Display variables:
$ Txt1 = "Learn PHP ";
$ Txt2 = "W3School.com.cn ";
$ Cars = array ("Volvo", "BMW", "SAAB ");
Print $ txt1;
Print"
";
Print "Study PHP at $ txt2 ";
Print "My car is a {$ cars [0]}";
?>
Okay. that's all for the time being. let's try again. You are welcome to join us !!!!!!
Callback has two basic output methods in php: the difference between echo and print: echo can output more than one string without returning...