echo: add example using here documents

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@64286 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
jim winstead 2001-12-08 19:46:08 +00:00
parent a6624f2fc5
commit 0ae200c9ee

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.130 $ -->
<!-- $Revision: 1.131 $ -->
<reference id="ref.strings">
<title>String functions</title>
<titleabbrev>Strings</titleabbrev>
@ -558,6 +558,13 @@ echo 'foo is $foo'; // foo is $foo
echo $foo; // foobar
echo $foo,$bar; // foobarbarbaz
echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;
// because echo is not a function, following code is invalid.
($some_var) ? echo('true'): echo('false');