Page 1 of ([^`]*?)<\/p>/" , $html, $num); $pgs = $num[0]; $pgs = explode("Page 1 of ", strip_tags($pgs)); $pgs = $pgs[1]; function createUrl($url,$lastnum) { $find = "?"; $trim = rtrim ($url,'a..z,A..Z,=,_,&'); $remove_to = strpbrk($trim, '?'); $number = 1; $counter= 0; while ($lastnum != $number) { $over = "?page=".$number."&"; $replace = str_replace($find,$over,$url); $myArray[$counter] = $replace; $number++; $counter++; } return $myArray; } function createList ($url ) { $counter=0; foreach ($url as $value){ $html=file_get_contents ($value); $myArray[$counter] = $html; $counter++; } return $myArray; } $c = 1; while($c <= $pgs){ $url = $furl . "?page=" . $c; $c++; $lastnum = 1 +1; //$url = createUrl($url,$lastnum); // $list = createList($url); $html=file_get_contents ($url); //foreach ($html as $value){ echo " "; preg_match_all ("/
([^`]*?)<\/div>/", $html, $matches); foreach ($matches[0] as $match) { preg_match ("/

([^`]*?)<\/h2>/", $match, $temp); preg_match ("/

([^`]*?)<\/p>/" , $match, $desc); preg_match ("/