Jump to content


Photo

File Question


  • Please log in to reply
2 replies to this topic

#1 redneonrt

redneonrt
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 29 June 2006 - 04:26 PM

Is there a way to have php look in a directory and add all the file names it finds into an array?

#2 kickassamd

kickassamd
  • Members
  • PipPipPip
  • Advanced Member
  • 102 posts
  • LocationDallas Tx

Posted 29 June 2006 - 04:41 PM

<?
$path = "path\to\folder";
$files = scandir($path);

print_r($files);
?>


Places each file and directory name with the give path into an array.

#3 redneonrt

redneonrt
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 29 June 2006 - 04:46 PM

Thanks, I found that right as you were replying.

Works perfect.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users