1048576) exit; $urlbasetopic = "http://www.jeuxvideo.com"; $urlfor = "http://www.jeuxvideo.com/forums/0-51-0-1-0-1-0-blabla-18-25-ans.htm"; $res = curl_get($urlfor); if(!$res) exit; preg_match_all('/\]*\>([^\<]*)\<\/span\>/',$res,$matches); if(empty($matches[1])) exit; foreach($matches[1] as $span_pseudo) { $pseudo = trim($span_pseudo); $pseudos[] = $pseudo; } } $pseudos = array_unique($pseudos); $f = fopen('pseudos.txt','w'); foreach($pseudos as $pseudo) { fwrite($f,$pseudo.PHP_EOL); } function curl_get($url) { $req = curl_init($url); curl_setopt($req,CURLOPT_FAILONERROR,true); curl_setopt($req,CURLOPT_RETURNTRANSFER,true); return curl_exec($req); }