/ Published in: PHP
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
Expand |
Embed | Plain Text
function file_content($_path) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_URL, $_path); $data = curl_exec($ch); curl_close($ch); return $data; }
You need to login to post a comment.
