Arrays

  • 14 years ago

    Hi, i have the following code

    <?php
            $handle = opendir("./vote_files/votes/");

            $i = 0;

            $file = readdir($handle);
            $file = readdir($handle);

            while(false !== ($file = readdir($handle)))
            {
                    $source = fopen("./vote_files/votes/" . $file, "r");
                    $line = fgets($source, 3);
                    $line = chop($line);



                    $values[i] = $line . "-" . $file;
                    print($values[i] . "<br />");
                    $i++;
            }


            //sort($values);
            $i = 0;

            while($i < 5)
            {
                    print("" . $values[i] . "-" . $i . "<br />");
                    $i++;
            }
    ?>




     

    what i am trying to do is get the files that have the highest number stored in them (each file has a number and nothign else in it)

    and then put it into an unordered list

    any ideas as to why this isnot working??

     

    Drogo

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”