how to use opendir() in mac os

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

how to use opendir() in mac os

Postby my_one_ebi » 14. July 2009 07:47

hi.
sorry for asking php code in xampp forum
i'm newbie of php and i got a home work from my lecturer,.
how to use opendir() to open the directory that i want, for example i want to open Application folder an show list of all file.
please send me immediately...
i need assisstance... :roll:
my_one_ebi
 
Posts: 2
Joined: 14. July 2009 07:31

Re: how to use opendir() in mac os

Postby my_one_ebi » 14. July 2009 07:47

here my code :
Code: Select all
<html>
<head>

<title>try to read directory</title>
</head>

<body>
<?
//$file = $directory . "/" . $file;
//$array_items[] = preg_replace("/ \/ \//si","/", $file);

$path=("../../../../");
//$file= directoryToArray("./",true);
//$directory=
$isi_dir = @opendir($path) or die("folder $path cannot be opened");
echo "directory content $path  : <br>";

while ($file = readdir($isi_dir))
{
      echo "<a href=$file>$file</a><br>";
      
}

closedir($isi_dir);

?>
</body>
</html>
my_one_ebi
 
Posts: 2
Joined: 14. July 2009 07:31


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 17 guests