Re: Cannot get this one correct and working, though simple!



Message-ID: <E_adnTHBbOGRzyjeRVn-uA@xxxxxxxxxxx> from Jerry Stuckle
contained the following:

>>>Single quotes! Try Double.
>>
>>
>> Single quotes are fine as is the code AFAICT.
>>
>
>No, with single quotes $i is not expanded. It would be with double quotes.

Looking at the code again he has

echo "<a href='$i.jpg' target='main'><img src='thumb$i.jpg'></a>

Now that can't be right or he's have a parse error, so I assumed he had

echo "<a href='$i.jpg' target='main'><img src='thumb$i.jpg'></a>";

which, for $i =1 gives:-
<a href='1.jpg' target='main'><img src='thumb1.jpg'></a>

In which case it would be in double quotes and would be expanded. In
fact the OP had already said it was expanded.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
.



Relevant Pages

  • Re: PHP scripts and IE
    ... > But it saves you having to think of whether to use single quotes or not. ... Single quotes mean that the content will be printed as-is. ... Thus single quoted strings are processed faster. ... would be the best solution IMO (although you might want to make it ...
    (alt.php)
  • Re: update hyperlink through query
    ... I tried it with double quotes first but someone told me single quotes ... My name's common all over the world. ... I have created a table in a database that contains hyperlinks pointing ...
    (microsoft.public.access.queries)
  • Re: nesting JS in echos
    ... converted from html to php. ... syntax of the single quotes and double quotes needed in the ...
    (comp.lang.php)
  • Re: br html line breaks and htmlentitities
    ... when reading user-supplied input I use 'addslashes' ... display, and so single quotes are not visually escaped, ...
    (comp.lang.php)
  • Re: Sending PHP variables through echo "
    "
    ... First error: using single quotes instead of double quotes. ... RTFM on the string type, specially on the subject of variable expansion. ...
    (comp.lang.php)