Re: simple I'm sure
| From: | Jack Dempsey | Date: | Wed, 14 Mar 2001 15:19:54 +0000 |
| Subject: | Re: simple I'm sure | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43850@lists.php.net to get a copy of this message | ||
try this...didn't test it, but i think it'll do the trick:
for($i=1;$i<50;$i++){
$varid = "quant".$i;
if($$varid != ""){
echo '<input type=hidden name="art_nr" value="';
echo $art_nr . $i;
echo '">';
echo '<input type=hidden name="quantity" value="';
echo $quant . $i;
echo '">';
}
}
jack
Keith wrote:
>
> Following loop works fine !
> but I don't want $art_nr_1 (which is 4564)
> I want to have $art_nr_$i
> but if you use it you just get 1,2,3,4
>
> for ($i=1; $i<50; $i++) :
> $varid = "quant".$i ;
> if ($$varid != "") {
> echo
> "
> <input type=hidden name=\"art_nr\" value=\"$art_nr_1\">
> <input type=hidden name=\"quantity\" value=\"$quant1\"> ";
>
> }
> endfor;
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net