getting data from readir() or glob() into an array

Discussion in 'PHP' started by Colbyt, Aug 20, 2007.

  1. #1
    I need to spend some time reading chapter 3 again.

    How can I take the output from readir() or glob() and get it into an array so that I can sort it?

    In the last 24 hours, I think I have seen ever php error message there is. And I still have not grasped the concept. I have finally mastered the ; at the end of every line :)
     
    Colbyt, Aug 20, 2007 IP
  2. Wildhoney

    Wildhoney Active Member

    Messages:
    192
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    
    
    <?php
    
    	$aFiles = glob('myDirectory/*');
    	print_r($aFiles);
    
    ?>
    
    
    PHP:
    ...And then you have ksort(), sort(), asort(), krsort(). Allsorts!
     
    Wildhoney, Aug 20, 2007 IP
  3. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #3
    Looks like I have to spread a little rep around.

    So I will just say Thanks here.
     
    Colbyt, Aug 22, 2007 IP