Re: Can I get the text from a string that is between two strings?
| From: | Jeff Warrington | Date: | Thu, 09 Nov 2000 10:08:08 +0000 |
| Subject: | Re: Can I get the text from a string that is between two strings? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24602@lists.php.net to get a copy of this message | ||
In article <3A06BA4F.91F1154C@jazzfree.com>, basurero@jazzfree.com wrote:
if (eregi("<[^>]+>([^<]+)",$text,$regs)) {
$string = $regs[1];
}
Jeff Warrington
>
> I need to get from a string the text between two xml tags. For
> example: The large string is:
>
> <article>
> <title>here goes title</title>
> <txtbody>Here goes the body of the article</txtbody>
> </article>
>
> I need to get the text between <txtbody> and </txtbody> without
> parsing th entire string.
>
> Thanks a lot
>