Re: returning first paragraph from a string
| From: | Lowell Allen | Date: | Thu, 04 Jul 2002 20:23:14 +0000 |
| Subject: | Re: returning first paragraph from a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105498@lists.php.net to get a copy of this message | ||
> From: Analysis & Solutions <danielc@analysisandsolutions.com>
>
> How's this?
>
> $summary = preg_replace('/^(.*)(\r?\n){2,}.*/', '\\1', $summary);
>
> --Dan
>
That's great -- works, and I generally see how it works. Thanks.
Also, can anyone recommend a good online reference, book, or tutorial for
regular expressions?
--
Lowell Allen