Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Turn PHP into CSS Drop Box Reply To: Turn PHP into CSS Drop Box

#204589
Alen
Participant

As @traq mentioned above, show us the data contained within $genres.

But in general, PHP foreach loop:


$numbers = array(1,2,3,4,5); foreach( $numbers as $number ) { echo $number; }; /* Result: 12345 */ $associates = array( 'president' => 'Jane Doe', 'assistant' => 'Joe Blow', ); foreach($associates as $role => $name) { echo $name . ', ' . $role . '<br/>'; }; /* Result: Jane Doe, president Joe Blow, assistant */

You can test your code online using http://viper-7.com/8owHD2

Hope that helps.