I tried to get the src of an iframe inside of an html using this
preg_match('/src=\'([^\']+)\'/', $fresult, $match);
but this code sometimes fails.
some sugest that I use an DomDocument But I can't found a reg exp sample
$doc = new DOMDocument();
$doc->loadHTML($html);
foreach ($tags as $tag) {
echo $tag->nodeValue;
}
How do I get the src value of frame?
sample
<iframe src='test.com' />
i should have test.com
also how do I do the preg_match_all equivalent of DomDocument?
like this
<html>
<label class="su">test1</label>
<label class="su">test2</label>
<label class="su">test3</label>
</html>
which is I should have a array result for test1, test2 and test3
I am new to this dom php thing. so please don't be harsh. thanks