Page 1 of 1

SIMPLEXML_LOAD_FILE ERROR - help please

Posted: Fri Dec 12, 2008 11:19 am
by nmpku
Below is my code. Everytime I run this, it gives me an error of "Bool False." Can anyone see anything wrong?

Code: Select all

 
$directory = '/path/to/directory/';
 
if ($handle = opendir($directory)) {
    echo "Directory handle: $handle\n";
    echo "Files:\n";
 
 //* This is the correct way to loop over the directory. */
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
 
//* Loop through each ad             
 
        foreach ($file as $ad); {
            $xml = simplexml_load_file("$directory$file");
            var_dump($xml);
 
            }
        }
    }
 
    closedir($handle);
 
}