RE: [PHP] what am I doing wrong? - closer!
| From: | Dan Joseph | Date: | Fri, 02 May 2003 19:45:05 +0000 |
| Subject: | RE: [PHP] what am I doing wrong? - closer! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146190@lists.php.net to get a copy of this message | ||
Hi,
> foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
> $quantity *= 1; // make it numeric
> if($quantity) { // if one exists
> echo $list_serv_cd;
> }
> }?>
>
> So, it looks like I am printing out the loop count. How can I print out
In a foreach:
foreach ($array as $name => $value) {}
that is the basics of how it works. If you want to print out the value,
simple echo $quantity.
-Dan Joseph