I want to try connecting to a remote file and writing the output from there to a local file, this is my function:
function get_remote_file_to_cache() { $the
You need to explicitly write to the file using fwrite, passing it the file handle you created earlier:
if ( $httpCode == 404 ) { ... } else { $contents = curl_exec($curl); fwrite($fp, $contents); } curl_close($curl); fclose($fp);