create a optgroup dynamically based on the value of an array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • millw0rm@gmail.com

    create a optgroup dynamically based on the value of an array

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


    for eg.,
    $data =
    array("apple"," age","axe","alp ha","beta","bas ic","byte","cry stal","call","c ­rypt","php","a pache","cgi","a jax","mysql","m onkey","giga"," kilobyte","spac e­","cyber","de lta","gamma","g erm","gemini"," words","code");

    natcasesort($da ta);


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


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


    For 'b'...


    <optgroup LABEL="B">
    <option VALUE="beta">be ta
    <option VALUE="basic">b asic
    <option VALUE="byte">by te
    </optgroup>
    ............... .......... so on


    thnx

  • Ian B

    #2
    Re: create a optgroup dynamically based on the value of an array

    Please don't multipost.

    Comment

    Working...