<?
// Read the webpage into the PHP script and store it as an array of strings
$theWebpage = file(##A VALID URL##);
// Read each line of the array
foreach ($theContents as $key => $value)
{
// If the string you want to find is in this line...
if(strpos($value, "##START OF THE STRING TO FIND##") !== FALSE)
$start = $key; // This is the line we want to start at
// If the start was already found, and the string you want to end on is in this line
if(isset($start) && strpos($value, "##END OF THE STRING TO FIND##") !== FALSE)
{
// This is the line we want to end at
$end = $key - 1;
break; // Stop the loop.
}
}
// Read all the lines in the webpage between the beginning and the end and store it.
for($i = $start; $i <= $end; $i++)
$theExtractedInfo .= $theWebpage[$i];
?>