void echo " string $arg1" [ , "string $..." ]
echo outputs one or more strings to web pages in response to HTTP requests, otherwise it outputs these to PHPoC's console for debugging.
echo is not a PHPoC function but language construct so it doesn't require parentheses.
※ available F/W version : all
No value is returned.
<?php
//this is a web page
echo "<html>";
echo "<head>";
echo "<title>Sample Web Page</title>";
echo "</head>";
echo "<body>";
echo "This is the first line<br />";
echo "This is the second line<br />";
echo "</body>";
echo "</html>";
?>
// OUTPUT TO A WEB BROWSER
This is the first line
This is the second line
<?php
$var1 = 1;
$var2 = 2;
$sum = $var1 + $var2;
$mul = $var1 * $var2;
echo "result:\r\n";
echo "sum: $var1 + $var2 = $sum\r\n";
echo "muliplication: ", "$var1 ", "* ", "$var2 ", "= ", "$mul", "\r\n";
// OUTPUT
// result:
// sum: 1 + 2 = 3
// muliplication: 1 * 2 = 2
?>
This function is identical to the PHP group’s echo but it doesn't support PHP group's shortcut syntax.