PHP echo() function is often used to output as string or text.
Syntax
void echo(str);
Parameter | Description |
---|---|
str : | Required parameter. The parameter or string to output. |
Return Value : | No value is returned. |
<?php echo "Hello World"; echo "This spans multiple lines. The newlines will be output as well"; echo "This spans\nmultiple lines. The newlines will be\noutput as well."; echo "Escaping characters is done \"Like this\"."; // You can use variables inside of an echo statement $str1 = "Header"; $str2 = "Footer"; echo "foo is $str1"; echo "foo is $str2"; ?>