You are here: Re: select tag « HTML « IT news, forums, messages
Re: select tag

Posted by Rik on 09/29/59 11:52

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
:-)

Grtz,
--
Rik Wasmus

 

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

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