PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This is interesting.
In the php manual (http://in.php.net/types.string),
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
How is any different/better than
$str = "
Example of string
spanning multiple lines
not using heredoc syntax.";
php manual wrote: Heredoc text behaves just like a double-quoted string, without the double-quotes. This means that you do not need to escape quotes in your here docs, but you can still use the escape codes listed above. Variables are expanded, but the same care must be taken when expressing complex variables inside a here doc as with strings.
If you're going to still need large blocks of text hardwired into your script without variable decompression (?word choice?), you may want to consider trying to seperate this info from the script, or, if all else fails, "Output Buffering". http://us2.php.net/manual/en/function.ob-start.php You shouldn't have to have huge blocks of text in your PHP script, by structuring your code correctly, it should be able to be ported to other files or databases.