String Functions in PHP [heredoc syntax]

The heredoc syntax:
In addition of the single quote and double quote syntaxex, PHP provides another way to specify a string called heredoc syntax. This syntax turns out to be a extremely useful for specifiying large chunks of variable-interpolated text, because it spares you from the need to escape internal quotation marks. It is especially useful in creating pages that contain HTML Forms.

The Operator in the heredoc syntax is < <

For Example:

$content = <<<EOD
Example of string’s
spanning multiple lines
using heredoc syntax.

Permanent link to this article:

Leave a Reply

Your email address will not be published.