In one’s server, file_get_contents is disabled for security reasons. I need to retrieve xml data. So, what is the best thing to do to :
- Verify that
file_get_contentsis supported by a server ? - Is there any subtitute methods of
file_get_contents?
You can check whether or not you can use url’s in
file_get_contents()(and thefopen()family of functions) by checking the ini directiveallow_url_fopen:You can get around these restrictions by using:
fsockopen()I strongly recommend cURL.
fsockopen()is a lot dirtier.