Hey all,
First, I tried finding the answer to this one on my own, but any question I found similar to mine was unanswered.
Say I have a string, $string.
$string="<p>text1</p><p>text2</p><p>text3</p>";
I want to extract text1.
eregi("<p>(.*)</p>", $string, $foo);
echo "$foo[1]" returns: text1</p><p>text2</p><p>text3.
Why? And how do I get around this? I thought I understood regular expressions until I ran into this problem.
Thanks!!