I have the following string:
$text = '<p><strong>2010</strong></p>
<ul>
<li>Content Content Content Content Content Content </li>
<li>Content Content Content Content Content Content </li>
</ul>
<p><strong>2009</strong></p>
<ul>
<li>Content Content Content Content Content Content </li>
<li>Content Content Content Content Content Content </li>
</ul>';
I need a way to extract the first paragraph text only.
echo extract($text);
output <p><strong>2010</strong></p>
What is the best way to do this? thanks