retrieving first paragraph
| From: | Lisi | Date: | Mon, 26 May 2003 10:07:57 +0000 |
| Subject: | retrieving first paragraph | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28040@lists.php.net to get a copy of this message | ||
I have a table column that stores a few paragraphs of text. I want a preview page that retrieves the first paragraph, and then links to the full text on another page.
1) Can I limit this in the MySQL query?
2) If not, how would I select all text up until the first \n? I so far have
ereg("(.){1,}\n", $text, $excerpt);
I want the parentheses to capture the text up until the \n in the variable $excerpt, and then stop there.
How do I do this with ereg?
Thanks,
-Lisi