html - Drop down list with foreach loop PHP -


i'm trying make drop down list php using foreach loop loop through data. works without drop down when displaying results in table loop work.

it seems drop down list gets populated (as list expands/contracts when i've added new fields in testing) no data shown. need show 1 field, though. here's code:

    <select name="language_select">         <?php foreach($this->getcontent('languages') $language => $value) : ?>             <option value="<?($language['name']);?>"></option>         <?php endforeach ?>     </select>  

so fetches array , tries return data, pretty simple. doing wrong?

i'm not sure of composition return of $this->getcontent('languages') think need.

<select name="language_select">     <?php foreach($this->getcontent('languages') $language) : ?>         <option value="<?= urlencode($language['name']);?>"><?= htmlspecialchars($language["name"]) ?></option>     <?php endforeach ?> </select>  

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -