Posted by comp.lang.php on 01/03/06 19:50
Oli Filth wrote:
> comp.lang.php said the following on 30/12/2005 16:16:
> > Jofio wrote:
> >
> >>
> >>But my problem is that part of the code ...<img src='thumb$i.jpg'> ...
> >>
> >
> > The problem lies in the way you embedded $i. PHP thinks you have a
> > variable literally called "$i.jpg" since a period is a valid implied
> > variable name character.
> >
>
> Umm, no... Who told you that?
The PHP manual. Assuming that is still your authority on PHP.
"Variable names follow the same rules as other labels in PHP. A valid
variable name starts with a letter or underscore, followed by any
number of letters, numbers, or underscores. As a regular expression, it
would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'"
>From http://us3.php.net/language.variables
Sorry to be off-topic.
Phil
>
> The problem is the use of single quotes rather than double quotes.
>
> --
> Oli
[Back to original message]
|