What does php echo mean?
echo in PHP is not a function (it is a language structure), so you do not have to use parentheses to specify parameters, single quotes or double quotes are fine. echo (unlike other language constructs) does not behave like a function, so it cannot always be used in the context of a function. In addition, if you want to pass multiple parameters to echo, you cannot use parentheses.
Basic usage of echo:
<?php echo "Hello world!"; ?>
echo also has a shortcut usage, you can use an equal sign directly before opening the mark. Before PHP 5.4.0, short_open_tag must be enabled in php.ini to be effective.
For example:
I have <?=$foo?> foo.
The main difference from print is that echo accepts a parameter list and has no return value.
Parameter arg1, the parameter to be output
Return value: No return value.
In short, php echo outputs strings or variables, similar to print in C language, and belongs to the grammatical structure of php.
The above is the detailed content of What does php echo mean?. For more information, please follow other related articles on the PHP Chinese website!