Re: Get text between A and B?

From: Philipp Lenssen (info_at_outer-court.com)
Date: 11/18/03


Date: 18 Nov 2003 11:21:17 GMT

Justin Koivisto wrote:

> Kinda like this then...
>
> function getTextBetween($allText,$textBefore,$textAfter,$offset=0){
> $pattern='#'.$textBefore.'(.*)'.$textAfter.'#iU';
> preg_match_all($pattern, $allText,$matches);
> return $matches[1][$offset];
> }

Thanks to that solution, and the other ones as well (I merged two
together). Works very nice.