note 93325 deleted from language.types.string by cmb
| From: | cmb@php.net | Date: | Sun, 04 Aug 2019 09:13:56 +0000 |
| Subject: | note 93325 deleted from language.types.string by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211805@lists.php.net to get a copy of this message | ||
Note Submitter: Liesbeth
----
If you need to emulate a nowdoc in PHP < 5.3, try using HTML mode and output capturing. This way
'$' or '\n' in your string won't be a problem anymore (but unfortunately,
'<?' will be).
<?php
// Start of script
ob_start(); ?>
A text with 'quotes'
and $$$dollars$$$.
<?php $input = ob_get_contents(); ob_end_clean();
// Do what you want with $input
echo "<pre>" . $input . "</pre>";
?>