void echo(string $str1 [, string $str2...])
//(PHP 4, PHP 5)//
^ $str1 | An expression to output. |
^ $str2... | Unlimited number of additional expressions to output. |
^ RETURNS | Nothing (void). |
===== What it Does =====
Sends output to the default device. In the case of a web page, this is the content delivered to the web browser. This is actually a language contruct rather than a function. This means you can use this statement without enclosing the arguments in parentheses (example shown below.)
There is a syntax shortcut for doing echo inside of HTML on your page. This looks like:
= $fullname ?>
===== Example =====
// echo without parentheses
echo 'Hello World!
';
// multiple arguments
echo 'Hi ', $first, ' ', $last, ', how are you?';
// you can use parentheses if you like
echo('Hello World!
');