1) comment ouvrir un fichier texte distant
2) comment copier une image distante ?  
 
function getFile($remote,$local,$login=false,$pass=false)
{
 $out = fopen($local, 'wb');
 $ch = curl_init();
 $options=array(
 	CURLOPT_URL=> $remote,
 	CURLOPT_FILE=> $out,
 	CURLOPT_HEADER=> 0,
   
 	CURLOPT_LOW_SPEED_LIMIT=> 500,    
 	CURLOPT_LOW_SPEED_TIME=> 8,    
 	CURLOPT_TIMEOUT=> 15,    
 );
 if($login&&$pass)$options[CURLOPT_USERPWD]=$login.':'.$pass;
 curl_setopt_array($ch, $options);
       
 curl_exec($ch);
 curl_error ($ch);    
 curl_close($ch);
 fclose($out);
}
 
getFile('http://site1.com/fichier1.txt ','./test.txt');
 
 
CURL a plus de possibilités et plus sûr, que fopen.