Tag Archives: String

Nowdoc

• similar to HEREDOC, but no parsing is conducted

• same <<< identifier, but the identifier must be enclosed in single quotes

• Do not indent ending identifier or add any chars

<?php
$string = <<<'DEMO'
 PHP Code
DEMO;

echo $string;
?>

wordwrap()

It wraps a string into new lines when it reaches a specific length.

Example

<?php
echo wordwrap(“It wraps a string into new lines when it reaches a specific length”,5);
?>

Output

It wraps a string into new lines when it reaches a specific length