PHP echo() Function

PHP echo() function is often used to output as string or text.


void echo(str);

echo() Function Parameter

str :Required parameter. The parameter or string to output.

echo() Function Return Value

Return Value :No value is returned.

echo() Function Example

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";