21
Hi Stefano,
thanks for visiting my website

Try this code for your problem:
le="color: #000000"><?php $countries = 'a:2:{s:5:"milan";s:6:"Milano";s:6:"naples";s:6:"Napoli";}'; $token = strtok($countries,';:'); $q=1; while ($token) { if (substr($token,0,1) == '"') { echo $q," ",$token," ",substr($token,1,-1); if ($q % 2 !=0) { echo " -> number is odd"; $country[$q]['id'] = substr($token,1,-1); } else { echo " -> number is even"; $country[$q-1]['name'] = substr($token,1,-1); } $q++; echo "<br>"; } $token = strtok(';:'); } echo "<br>"; echo"<select name='countries'>"; foreach (array_keys($country) as $j) { $country_id = $country[$j]['id']; $country_name = $country[$j]['name']; echo"<option value=".$country_id.">$country_name</option>n"; } echo"</select>";
arrivederci,
Marco
--
Match Dart!Darts Ranking, News, Videos, Forum and more