Jump to content

Looping


Jeneca

Recommended Posts

This should actually go to the PHP forum (from your Languages information in your profile i assume you use PHP and not ASP). Anyway here is the way i'd dynamically create the list.

<select> <?php   //Let's assume you have a class or a function that returns and stores the store names in an array, using a function in this example   $store_names = get_store_names();   $max_stores = count($store_names) // Gets the number of the array elements   for($i = 0; $i < $max_stores; $i++)      echo '<option value="store' . $i+1 . '">' . $store_names[$i] . '</option>'; ?></select>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...