Reply to Re: select tag

Your name:

Reply:


Posted by Jonathan N. Little on 09/26/70 11:52

Rik wrote:
> Jonathan N. Little wrote:
>> Rik wrote:
>>>> $v = htmlentities($data['option']);
>>>> printf("\t<option value=\"%s\">%s</option>\n", $v, $v);
>>> ==
>>> printf("\t<option value=\"%1$s\">%1$s</option>\n",
>>> htmlentities($data['option']));
>> Ok you are using argument swapping to repeat the variable, but doesn't
>> the placeholder require a '\'?
>>
>>
>> printf("\t<option value=\"%1\$s\">%1\$s</option>\n",
>> htmlentities($data['option']));
>
> You're right, I was somewhat hasty (and I normally never double quote HTML
> code, the times I need variables in HTML it's usually a larger block using
> heredoc syntax).
>
> Assigning these kind of temporary variables where they aren't necessary
> (neither for the code nor for the readability) is just a pet peeve of mine
> :-)

You sure that will not cause a second evaluation of htmlentities?

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

[Back to original 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

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