How do you display a file with cURL?
2 answers
If your web server allows it, it's file_get_contents()
even easier.
echo file_get_contents('http://www.example.com/path/to/your/file.ics');
If you can't open URLs with file_get_contents()
, check out all the stuff on Stack Overflow which I think should be good for newbies.
+3
a source to share
If remote is file_get_contents
not enabled, cURL can actually do this.
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://example.com/file.ics');
// this is the key option - sets curl_exec to return the HTTP response
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$file_contents = curl_exec($curl);
0
a source to share