Jump to content

[SOLVED] using simpleXML to open an xml file in another folder?


bdee1

Recommended Posts

all the examples i have see for using siimpleXML to open an xml file assume that the xml file is in the same folder as the php page... so it looks something like this:

$xml = simplexml_load_file('file.xml');

 

but what if the xml file is in another path like this:

$xml = simplexml_load_file('./data/file.xml');

 

when i try using the latter, it tells me:

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "./data/file.xml"

 

so whats the correct way to use simplexml to open a file in another folder?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.