Re: Cleaner way to do this?
| From: | Thomas Munz | Date: | Thu, 02 Dec 2004 16:39:36 +0000 |
| Subject: | Re: Cleaner way to do this? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203364@lists.php.net to get a copy of this message | ||
> foreach ( $_POST as $key => $value )
> {
> while ($key != "submit")
> {
> \$$key = $value;
> $addtocart .= ",'\$$key'";
> }
> }
>
> The problem is that it seems to be hanging at the while loop. Is there a
> cleaner way to write the foreach loop so that it will dump out the "submit"
> key? I've been trying different combinations, and am sure it is something
> simple I have boffed.
>
> Thanks,
> Robert
>
> --
> Robert Sossomon, Business and Technology Application Technician
> 4-H Youth Development Department
> 200 Ricks Hall, Campus Box 7606
> N.C. State University
> Raleigh NC 27695-7606
> Phone: 919/515-8474
> Fax: 919/515-7812
> robert_sossomon@ncsu.edu
foreach ( $_POST as $key => $value )
{
if($key != "submit")
{
$addtocart .= ",$key";
}
}