Thursday, February 13, 1997

How to access the root directory php?

I would like to know how to access an outside directory if my file is located in another directory.

eg. reading directory B from Directory A Which are both in directory C

this is what I tried:
readdir("/B");

this however doesn't work.

Answer on How to access the root directory php?

<?php

$dh = opendir('../B');
while($file = readdir($dh)){
echo $file . '<br>';
}

?>

Good Luck.

Cheers,
Gitlez