RE: [PHP] Problems with arrays
| From: | Ford, Mike [LSS] | Date: | Thu, 17 Jun 2004 14:05:59 +0000 |
| Subject: | RE: [PHP] Problems with arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-188486@lists.php.net to get a copy of this message | ||
On 17 June 2004 14:27, Phpu wrote:
> Here is the code:
>
> <select name="model" class="gform"
> onchange="model_jump('parent', this)">
> <option value="0">
> <?
> foreach ($nav_model_names as $index => $element) {
> $InputString = "$element";
> echo "$InputString";
> }
> > </option>
> </select>
Each option needs to be in, er, <option></option> tags, do you want something like:
foreach ($nav_model_names as $index => $element) {
echo "<option value='$index'>$element</option>\n";
}
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211