|
Posted by Oli Filth on 01/03/06 20:14
comp.lang.php said the following on 03/01/2006 17: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.
No it didn't.
> "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]*'"
Where is a period mentioned in that quote?
Indeed, as a counter-quote from the manual:
> "However, it should be noted that the dot (period, full stop) is not
> a valid character in a PHP variable name."
(http://www.php.net/manual/en/language.variables.external.php#language.variables.external.dot-in-names)
Think about it - it's the string concatenation operator - how could it
be used as a character in a variable name?
--
Oli
[Back to original message]
|