Hi problem

Discussion in 'Programming' started by addisoft, Sep 7, 2010.

  1. #1
    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","cg i","ajax","mysql","monkey","giga","kilobyte","spac e*","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
     
    addisoft, Sep 7, 2010 IP
  2. busterkeaton

    busterkeaton Active Member

    Messages:
    665
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #2
    i think youre on the wrong forum...
     
    busterkeaton, Sep 7, 2010 IP
  3. addisoft

    addisoft Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sorry, where i have to go for this..I need to solve this problem today..
     
    addisoft, Sep 7, 2010 IP
  4. easyhostingplans.info

    easyhostingplans.info Peon

    Messages:
    507
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    search for the programming language + forum in gogole.
    example for C language search : c language forum
     
    easyhostingplans.info, Sep 7, 2010 IP