Sonic42
Sonic42

Reputation: 689

Safely Use PHP to Get Remote XML

I'm trying to retrieve some remote XML from another source using PHP. I understand that you're not supposed to enable allow_url_fopen for security reasons, so I'm not really sure how to go about doing this.

Upvotes: 0

Views: 204

Answers (2)

CodeCaster
CodeCaster

Reputation: 151604

Allow_url_fopen isn't unsafe or scary or dangerous per se, it's just that quite often it is disabled on shared hosting for various reasons.

If you control your own hosting environment, I'd say go with it. Otherwise, use curl as suggested.

Upvotes: 0

favoretti
favoretti

Reputation: 30167

You might want to use curl for that. If your XML is available via HTTP, first curl it, then feed it to the XML parser.

Upvotes: 3

Related Questions