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
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024