BWGames wrote:
I now need to search for a string and return the next X characters to
it....
[snip] I'm looking at
between... sometihng like between
between ('string1', 'string after what i want',$retrievedpage);
<?php
function text_after($haystack, $needle, $size) {
$pos = strpos($haystack, $needle);
if ($pos === false) return false;
return substr($haystack, $pos+strlen($needle), $size);
}
$text = 'one two three four five six seven';
$found = text_after('three', 5, $text);
if ($found === false) echo "Not found\n";
else echo 'Found: ', $found, "\n";
?>
--
USENET would be a better place if everybody read: | to mail me: simply |
http://www.catb.org/~esr/faqs/smart-questions.html | "reply" to this post, |
http://www.netmeister.org/news/learn2quote2.html | *NO* MIME, plain text |
http://www.expita.com/nomime.html | and *NO* attachments. |