Extracting the first two paragraphs of a content
Posted: Mon Jun 29, 2009 9:46 am
Hi,
I would like to extract the first two paragraphs of a content from a database, the code i got it from somewhere works fine only to extract one (first) paragraph in the content...
how can i get around to this tricky part...?
Let's say this is my content from the database,
Thanks,
Lau
I would like to extract the first two paragraphs of a content from a database, the code i got it from somewhere works fine only to extract one (first) paragraph in the content...
Code: Select all
<?php echo substr($row_feeds['pg_content'], 0, strpos($row_feeds['pg_content'], "</p>"));?>Let's say this is my content from the database,
Code: Select all
<p>xxxxx</p>
<p>xxxxx</p>
<p>xxxxx</p>Lau