Bonjour,

j'ai un script qui me récupères environs 500 000 images sur HTTP tous les jours. Cela me prend plusieurs heures et ne m'arrange pas.

voici ce que je fais :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
for($i = 0; $i< $maxdatas; $i++) { 
 
 
 
    for($ii=1; $ii<= 5; $ii++) {   //10
        $data['photo'.$ii] = "http://www.monsite.com/monimage.jp";
        if($data['photo'.$ii] != "") {
            $image_content = @file_get_contents($data['photo'.$ii]);
            if($image_content != "") {
                $fphoto = @fopen("images/".generate_guid().".jpg", "w+");
                fwrite($fphoto, $image_content);
                @fclose($fphoto);
            }
        }
    }
}
Comment puis-je optimiser tout ça ?

Merci pour votre aide