FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » option values with php foreach not working
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: option values with php foreach not working [message #171115 is a reply to message #171112] Sat, 25 December 2010 03:29 Go to previous messageGo to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
Never mind all of the above.
Finally fixed the problem. Just a matter of where you put stuff.

<body>


<?php

$arr = array("one", "two", "three");
foreach ($arr as $key => $value)
{ echo "Key: $key; Value: $value<br />\n"; }

$myArray=array(1,2,3,4,5);

?>

<select name="menu1" size="10">
<option value="101">adam</option>

<?php

foreach ($myArray as $myItem)
{ echo "<option value='$myItem'>$myItem</option>\n"; }
?>
</select>
</body>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Slowly coming together
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 09:38:09 GMT 2024

Total time taken to generate the page: 0.05077 seconds