| 
	
 | 
 Posted by Jonathan N. Little on 07/09/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
 
  
Navigation:
[Reply to this message] 
 |