|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-01 00:36 UTC] vandor at freestart dot hu
Description:
------------
This is a feature request:
A new string separator character ie:#, with variable parsing
To write string contains double-quotes and variables have 4 different solution:
$s = "<p class=\"$class\" id=\"$id\">";
$s = '<p class="'.$class.'" id="'.$id.'">';
$s = <<<HEREDOC
<p class="$class" id="$id"
HEREDOC;
$s = sprintf('<p class="%s" id="%s">', $class, $id);
would suggest a 5th solution:
$s = #<p class="$class" id="$id"#;
Think it would produce cleaner, readable code when write html strings.
The # character used only for example, any may find a better one.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 18:00:01 2025 UTC |
What about using [string] or {string} or :string: ? These separators can't occur at the same place as a string.