Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Readdir arranged into a table.

    I've been programmin PHP for over two years now and I've only just realised I don't know how to do something! Iam currently retreiving all the conetnts of a folder using readdir. I want to be able to arrange all these files into a table three columns wide but I don't know how!

    I want it to be like this:

    1|2|3
    4|5|6
    7|8|9

    Can anyone help?

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Posts
    951
    Thanks
    1
    Thanked 31 Times in 29 Posts
    Not readdir, but it should be similar:
    PHP Code:
    $files glob('*');

    for (
    $i 0$i count($files); ++$i)
    {
        echo 
    $files[$i];
        echo ((
    $i 1) % && $i != count($files) - 1) ? '|' '<br />';



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •