Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Parse error message? Re: Parse error message?

#131137
__
Participant

Another option for HTML strings (especially larger ones) which I prefer is HEREDOC syntax.

$html_string = <<

Using HEREDOC Notation

A “HEREDOC” starts with three less-than brackets,
followed by an identifier of your choosing.
I used [uppercase] “html”, but any text works.
It ends with that same identifier (*all by itself*, on a new line!)
and the closing semicolon.

As you can see, both single- and double-quotes
aren’t a problem inside a HEREDOC.
You can also use $variables
(or even {$arrays})
but not functions() or CONSTANTS.
HTML
;