Bonjour, j'essaye d'afficher les données de mon array mais mon select reste vide voici mon code :
function array :
<?php
function getOptions() {
return array(
array('value' => '0', 'text' => '---'),
array('value' => '1', 'text' => 'Boucle du Mouhoun'),
array('value' => '2', 'text' => 'Cascades'),
array('value' => '3', 'text' => 'Centre'),
array('value' => '4', 'text' => 'Centre-Est'),
array('value' => '5', 'text' => 'Centre-Nord'),
array('value' => '6', 'text' => 'Centre-Ouest'),
array('value' => '7', 'text' => 'Centre-Sud'),
array('value' => '8', 'text' => 'Est'),
array('value' => '9', 'text' => 'Hauts-Bassins'),
array('value' => '10', 'text' => 'Nord'),
array('value' => '11', 'text' => 'Plateau-Central'),
array('value' => '12', 'text' => 'Sahel'),
array('value' => '13', 'text' => 'Sud-Ouest'),
);
}
HTML FORM :
<form action="POST">
<label class="cb label">ARCHITECTES CONCEPTEURS</label>
<input type="text" class="input" required/>
<br><br>
<label class="cb label">AGGLOMERATION</label>
<input type="text" class="input" required/>
<br><br>
<label class="cb">REGIONS</label>
<select>
<option value="" selected="selected">
<?php
foreach($options as $k => $v) :
foreach($v as $r) :
echo $r"text"];
endforeach;
endforeach;
?>
</option>
</select>
<br><br>
<input type="submit" class="submit" value="RECHERCHER">
</form>
Merci