|
Written by Roceller Alvarez
|
|
Saturday, 26 February 2005 |
|
Here’s a quick code sample that demonstrate a qucik way in using an array in PHP.
<? $category = array( 1=> "option1", 2=> "option2", 3=> "option3" ); $category = str_replace(" ", " ", $category); echo ‘<SELECT name=category>’; foreach ($category as $key => $value) { echo ‘<OPTION value=’.$value.’> ‘.$value.'’; } echo ‘</select>’; ?>
Only registered users can write comments. Please login or register. Powered by AkoComment 2.0! |