LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   perl opendir like function for php? (https://www.linuxquestions.org/questions/programming-9/perl-opendir-like-function-for-php-94977/)

paulish 09-20-2003 07:40 PM

perl opendir like function for php?
 
i was just wondering... is there a opendir and readdir function for php like there is in perl? or do i have to create a file with the names of all files within the folder to be able to see all files in a directory (sorry if that didn't make much sense). ?????

thanks,
paulish

SaTaN 09-20-2003 10:47 PM

Code:

<html>
<title>
ls --- command
</title>
<?php
$all=shell_exec("ls directory_path");
$content=preg_split ("/\s+/", $all);
foreach ($content as $file)
print"$file <br>";
?>

</html>

I suppose this wud do this for you ....

then 09-21-2003 03:45 AM

Hi

Quote:

is there a opendir and readdir function for php...
Think this is what you're looking for -
http://www.php.net/manual/en/ref.dir.php

regards
theN
ps: maybe the next time you'll search the manual before asking ;)


All times are GMT -5. The time now is 02:15 AM.