PHP string tip
24th June 2002
I’ve lost count of the number of times I’ve posted this PHP tip on a forum somewhere, so I may as well blog it:
$string = <<<EOD This string can contain both "double" and 'single' quotes, and any variables such as $name will be interpolated (i.e replaced with their value). The string ends at the first occurence of the sequence of characters specified at the beginning after the <<<, like this: EOD;
More on this feature can be found in the PHP manual.
More recent articles
- My AI/LLM predictions for the next 1, 3 and 6 years, for Oxide and Friends - 10th January 2025
- Weeknotes: Starting 2025 a little slow - 4th January 2025
- I still don't think companies serve you ads based on spying through your microphone - 2nd January 2025