php - How to parse multiple html pages into a string?
I'm trying to parse the code of multiple html pages into a string, to make like a buffer, and read this string in order to find a specific text that are input, everthing is ok, the only problem, is that I'm not able to load the pages into the string and read after.
$url = 'http://www.test.com/';
$start = 0;
$end = 1120;
$counter = $start;
while ($counter <= $end) {
/*** a link to search - add the counter value and html to the end of url ***/
$link = "$url$counter.html";
/*** get the links ***/
$data = file_get_contents($link);
$data = $data.$data;
// echo $data;
$counter = $counter + 15;
}
Could someone help me in this case?
Regards
Answer
Solution: