I want to extract data which is in following form:
<div class="image"><a href="[Any Chacter]">
I got the data up to <div class="image"> but after that no result. This is my code:
$tag_regex='/<div class="image">/';
preg_match_all($tag_regex,$xml,$matches);
return $matches[0];
Just as Truth said in his comment, the proper way to extract data from html is an html parser.
However, your case is simple and could be solved easily and quickly with a regex: