Unless you need more than just the contents of the file, you could use file_get_contents
.
$xml = file_get_contents("http://www.example.com/file.xml");
For anything more complex, I’d use cURL.
More Related Contents:
- Get url as www.abcd.com?curr=USD
- Recommendations for processing incoming data on a web server [closed]
- What is the size limit of a post request?
- Download File to server from URL
- Setting Curl’s Timeout in PHP
- How to pass extra variables in URL with WordPress
- What is the canonical way to determine commandline vs. http execution of a PHP script?
- How to use HTTP cache headers with PHP
- Manually parse raw multipart/form-data data with PHP
- Super fast getimagesize in php
- Beautiful way to remove GET-variables with PHP?
- Correct way to set Bearer token with cURL
- setcookie, Cannot modify header information – headers already sent [duplicate]
- How to include Authorization header in cURL POST HTTP Request in PHP?
- PATCH and PUT Request Does not Working with form-data
- How to switch from POST to GET in PHP CURL
- Using the PHP HTTP_ACCEPT_LANGUAGE server variable
- How to get final URL after following HTTP redirections in pure PHP?
- Get Text From Tag Using PHP
- Who Add “_” Single Underscore Query Parameter?
- How to set $_GET variable
- How to make HTTP requests in PHP and not wait on the response
- PHP – Plus sign with GET query
- Load Blade assets with https in Laravel
- Get “Content-Type” header of request in PHP
- Detecting whether a user is behind a proxy
- Find out HTTP method in PHP [duplicate]
- Asynchronous HTTP requests in PHP
- Sending XML data using HTTP POST with PHP
- HTTP protocol’s PUT and DELETE and their usage in PHP