You are here: create a optgroup dynamically based on the value of an array « PHP Programming Language « IT news, forums, messages
create a optgroup dynamically based on the value of an array

Posted by millw0rm@gmail.com on 10/01/42 11:33

hi, how to create a optgroup dynamically based on the value of an
array...


for eg.,
$data =
array("apple","age","axe","alpha","beta","basic","byte","crystal","call","c­rypt","php","apache","cgi","ajax","mysql","monkey","giga","kilobyte","space­","cyber","delta","gamma","germ","gemini","words","code");

natcasesort($data);


i want all the array=>values starting with letter 'a' shld be grouped
like


<optgroup LABEL="A">
<option VALUE="apple">apple
<option VALUE="age">age
<option VALUE="axe">axe
</optgroup>


For 'b'...


<optgroup LABEL="B">
<option VALUE="beta">beta
<option VALUE="basic">basic
<option VALUE="byte">byte
</optgroup>
......................... so on


thnx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация