]*class=\"streamstats\">(.*)<\/td>"; $search_td = array('',''); if(preg_match_all("/$search_for/siU",$output,$matches)) { foreach($matches[0] as $match) { $to_push = str_replace($search_td,'',$match); $to_push = trim($to_push); array_push($temp_array,$to_push); } } $stream_info['currently_playing'] = $temp_array[$indexPlaying]; $stream_info['auditeurs'] = $temp_array[$indexListeners]; $x = explode(" - ", $temp_array[$indexPlaying]); $stream_info['artiste'] = $x[0]; $stream_info['titre'] = $x[1]; return $stream_info; }