This is handy function which i have been using i put it together myself and use it alot to get data out of documents.
// (c) Ollie Kett 2009
function FindIt($content, $start, $end) {
$haystack = strstr($content, $start);
$r = substr($haystack, 0, strpos($haystack, $end));
$remove = array($start);
$with = array('');
$output = str_replace($remove, $write, $r);
return $output;
}