John Wells wrote:
Personally, I get tired (and confused) when having to escape all of
those quotes like in the string you're trying to echo above. Perhaps
you'd consider HEREDOC as an alternative approach:
Here's n idea I've had and never expressed publicly before. I wonder if
some of you haven't thought the same thing:
Why not develop a language syntax that has distinct open and close
string delimiters?
So (in an ideal world) the code in question
echo "
<td width=\"25%\" align=\"center\">
<a
href=\"javascript:open_window('$php_self?action=view_record&userid=$userid');\">
view</a>
<a href=\"$php_self?action=delete_record&userid=$userid\"
onclick=\"return confirm('are you sure?');\">delete</a></td>
";
would be rendered something like this:
echo {
<td width={25%} align={center}>
<a
href={javascript:open_window({$php_self?action=view_record&userid=$userid});}>
view</a>
<a href={$php_self?action=delete_record&userid=$userid}
onclick={return confirm({are you sure?});}>delete</a></td>
};
or like this:
echo [
<td width=[25%] align=[center]>
<a
href=[javascript:open_window([$php_self?action=view_record&userid=$userid]);]>
view</a>
<a href=[$php_self?action=delete_record&userid=$userid]
onclick=[return confirm([are you sure?]);]>delete</a></td>
];
Of course, having separate characters for opening and closing double or
single quotes would work, but that would require changing the basic
ASCII set.
I believe some European languages use "<<" and ">>" as quotation marks.
What ASCII characters do they use?
I have seen some JavaScript code that uses curly braces to delimit a
string, but can't find that documented anywhere.
Thoughts anyone?
--J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php