Re: using foreach() to capture multiple selections

From: Date: Tue, 21 Sep 2004 19:50:28 +0000
Subject: Re: using foreach() to capture multiple selections
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-197470@lists.php.net to get a copy of this message
From: "Luke Mackenzie" <luke@lukem.co.uk>
i would like to to put multiple selections from a form list into a single variable using foreach but am unsure how to do so. can someone advise how to adapt the following code? print "You are interested in: "; foreach($myGoals as $value) { print "$value "; }
$var = implode(' ',$myGoals); or foreach($myGoals as $value) { $var .= $value . ' '; } First method is easier. ---John Holmes...

« previous php.general (#197470) next »