Jump to content

use of heredoc strings


portia

Recommended Posts

I'm a newbie reading php documentations. I have a hard time grasping the idea/use of heredoc strings. That's an example from the php website

 

$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;

 

I understand it is useful when you have multiline string variables. Is that it? Is this the only advantage of heredoc strings or there's more to it?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/241320-use-of-heredoc-strings/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.