You are here: Re: Cannot get this one correct and working, though simple! « PHP Programming Language « IT news, forums, messages
Re: Cannot get this one correct and working, though simple!

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация