|
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]
|