Web Hosting Talk







View Full Version : Help :: Directory Listing = findfirst() function ????


webkami
08-25-2002, 12:41 PM
Hi
i wanted to get remote directory's file list
in C it was done with
findfirst()


How can i do it in PHP
Any body please help

P.S.
I Already searched PHPManual

phpcoder
08-25-2002, 10:51 PM
Textbook php:


<html>
<head>
<title>Listing 10.14</title>
</head>
<body>
<?
$dirname = ".";
$dh = opendir( $dirname ) or die("Couldn't open directory");

while ( ! ( ( $file = readdir( $dh ) ) === false) ) {
if ( is_dir("$dirname/$file" ) )
print "";
print "$file<br>";
}
closedir( $dh );
?>
</body>
</html>



I can't get it not to compact :(

webkami
08-26-2002, 07:10 AM
Thanx a LOOOOOOOOOOOT



[quote]Textbook php: [quote]

Where i can find this book?
is there any online version?

or any help that include these functions?

phpcoder
08-26-2002, 09:51 AM
Actually it is the first book that I ever got about php. Its called:

"Sams Teach Yourself PHP in 24 Hours"

Hope that helps you :)

webkami
08-26-2002, 11:53 PM
Yes Thanx ,

I am off to a book shop :D