help me to sort my list in grouping

3 replies
i have list of movies A to Z in array i can do simple sort but i want them to sort in grouping like this
A
[movie name],
[movie name],
[movie name],
[movie name],

B
[movie name]
[movie name]
[movie name]
[movie name]
[movie name]

C
[movie name]
[movie name]
[movie name]
[movie name]

D
[movie name]
[movie name]
[movie name]
[movie name]

and go on

all movies name will be links but A,B,C,D will be remain simple
how can i do this
i wanna show list like this see this website
please visit mp3hungama
i cannot post link due to low posts
thanks
#grouping #list #sort
  • Profile picture of the author omarusman
    I think I can help you, let me know if you're interested.
    If you can send me a sample list (txt file), may be 3 entries per letter, that will be great for me too look at.
    {{ DiscussionBoard.errors[5371707].message }}
  • Profile picture of the author lovefax89
    my code is this...right now i am not using any type of db.i am just doing in simple php page.

    <?php

    class template{

    function list_films_a_to_n()
    {
    return array(
    "LOVE"=>"Ay.php",
    "Nomi"=>"nomi.php",
    "Nomi Zain"=>"nomi.php",
    "Nomi zain"=>"nomi.php",
    "Fat"=>"ima.php",
    "Ha"=>"h.php",
    "A"=>"a.php",
    "Z"=>"z.php",
    );
    }
    }



    <div class="listAtoZ">
    <?php
    include_once("template.php");
    $temp1=new template();
    $list=$temp1->list_films_a_to_n();
    ksort($list);
    echo "<table id='AtoZ' border='1px'>";
    foreach($list as $keyvalue => $page)
    {
    echo "<tr>";
    echo "<td><a href=$page>$keyvalue</a></td>";
    echo "</tr>";
    }
    echo "</table>";

    ?>
    </div>

    problem is all my array listed with links but i want only movies with link
    and A,B,C,D simply right without link
    {{ DiscussionBoard.errors[5371878].message }}
  • Profile picture of the author omarusman
    I think you need something called RegEx to leave out the links. Just let me know, I can help you.
    {{ DiscussionBoard.errors[5376346].message }}

Trending Topics