<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'ENDOFSTRING PHP Strings'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 05:29:56 GMT</pubDate>
<item>
<title>shaunduncan said on 7/13/10</title>
<link>http://snipplr.com/view/37127/endofstring-php-strings/</link>
<description><![CDATA[ The above snip should be:

<pre>
<?php ...some code... ?>
This is a string 

It can include both 'single' and "double" quotes 
without needing to escape them. However, $variables 
will still be interpolated as they are in double 
quoted strings. Complex variable expressions such as 
<?php echo $array['element']; ?> or <?php echo $object->property ?> can also 
be included and will be evaluated if they are included 
in curly braces (they may work without curly braces 
but I tend to include them for added clarity). The 
string will terminate with whatever you specified 
at the start like this:
<?php ...more code... ?>
</pre> ]]></description>
<pubDate>Tue, 13 Jul 2010 02:27:28 GMT</pubDate>
<guid>http://snipplr.com/view/37127/endofstring-php-strings/</guid>
</item>
<item>
<title>shaunduncan said on 7/13/10</title>
<link>http://snipplr.com/view/37127/endofstring-php-strings/</link>
<description><![CDATA[ This is known as HEREDOC syntax (http://bit.ly/j5IAU) ...it's useful for very long bits of text, but not great at all for performance. What is generally better is to use single quotes for strings and append variables that way the parser doesn't have to search the entire string first for variables (although you lose the ability to not escape double and single quotes). Then again, if you plan on just echoing back the entire string, you don't have to make an call at all...and in fact it works great since the php parser will completely ignore it:

<pre>

his is a string 
 
It can include both 'single' and "double" quotes 
without needing to escape them. However, $variables 
will still be interpolated as they are in double 
quoted strings. Complex variable expressions such as 
 or  can also 
be included and will be evaluated if they are included 
in curly braces (they may work without curly braces 
but I tend to include them for added clarity). The 
string will terminate with whatever you specified 
at the start like this:

</pre> ]]></description>
<pubDate>Tue, 13 Jul 2010 02:24:10 GMT</pubDate>
<guid>http://snipplr.com/view/37127/endofstring-php-strings/</guid>
</item>
<item>
<title>Vordreller said on 7/12/10</title>
<link>http://snipplr.com/view/37127/endofstring-php-strings/</link>
<description><![CDATA[ The 3 < signs are necessary? ]]></description>
<pubDate>Mon, 12 Jul 2010 11:31:57 GMT</pubDate>
<guid>http://snipplr.com/view/37127/endofstring-php-strings/</guid>
</item>
</channel>
</rss>