php - How to parse multiple html pages into a string? -
i'm trying parse code of multiple html pages string, make buffer, , read string in order find specific text input, everthing ok, problem, i'm not able load pages string , read after.
$url = 'http://www.test.com/'; $start = 0; $end = 1120; $counter = $start; while ($counter <= $end) { /*** link search - add counter value , html end of url ***/ $link = "$url$counter.html"; /*** links ***/ $data = file_get_contents($link); $data = $data.$data; // echo $data; $counter = $counter + 15; }
could me in case?
regards
$url = 'http://www.test.com/'; $start = 0; $end = 1120; $counter = $start; $data=""; while ($counter <= $end) { $link = "$url$counter.html"; $res = file_get_contents($link); if ($res!==false){ $data .=$res; } $counter = $counter + 15; }
Comments
Post a Comment