Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

bcworkz on "pick up XML from a 3rd party server via FTP?"

$
0
0

I assume the files on their FTP server are already in XML format, so you would be simply be requesting the file(s) from the server. PHP offers a few ways to do this. You can use native ftp_*() functions just like you would use fopen() etc. for local files.

You could also use file_get_contents(), which may be your best choice. There is also cURL, which may or may not be installed on your server. It's more complicated to use, but provides some good, powerful options not available through native functions.

Once you get the file, you probably need to extract the details and assign them to PHP variables for further processing. You use an XML parser for this. Again, there are a few options. XML Expat, DOM XML, and SimpleXML are all PHP core parsers available to you. There are more powerful extensions available as well.


Viewing all articles
Browse latest Browse all 3201

Trending Articles