Hello
I'm learning regexp and I'm trying to get contents in a div tag.
<div class='name'>
<div class='contents'>
contents
</div>
</div>
my regexp is something like this
preg_match_all("/\<div class=\"name\"\>(.*?)\<\/div\>/is",
$res, $matches );
foreach($matches[0] as $value)
{
echo $value;
}
I want to get everything in the div class='name' but I think that php is going to stop executing after getting the first </div> tag. How do I get the whole div tag?
Thanks