Re: little problem with ' " and stuff
| From: | David T-G | Date: | Mon, 10 Feb 2003 13:52:34 +0000 |
| Subject: | Re: little problem with ' " and stuff | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135053@lists.php.net to get a copy of this message | ||
Michael --
..and then Michiel van Heusden said...
%
% hi there,
Hi!
%
% i'm having a small problem, wondering if anybody can help
..
% echo '<frame name="main" scrolling="no"
src="'$url'">';
You've already seen the suggestions to . together your parts, so I
needn't suggest that.
I wonder why on earth you're bothering, though! If you use ' then you
will, indeed, need to . the $variables into the string, but if you use "
then you can just include them with the rest of your output. Your
incorrect
echo '<frame name="main" scrolling="no"
src="'$url'">';
instead of having to become
echo '<frame name="main" scrolling="no" src="' . $url .
'">';
is simply
echo "<frame name='main' scrolling='no'
src='$url'>";
and away you go...
I, too, have wondered why pretty much everyone on this list writes their
html as
<tag field="data">
rather than using perfectly valid single quotes and making their lives
easier... In perl you can use *any* char as your quoting character and
so you even have it both ways!
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!