I have a html page like this
<!DOCTYPE html>
<html>
....
<body>
<div class="list-news fl pt10 ">
Blue
</div>
<div class="list-news fl pt10 alternative">
Yellow
</div>
<div class="list-news fl pt10 ">
Red
</div>
<div class="list-news fl pt10 alternative">
Cyan
</div>
<div class="list-news fl pt10 ">
Black
</div>
<div class="list-news fl pt10 alternative">
White
</div>
</body>
</html>
Now i will write a sort php code for get all content i need
preg_match_all('@<div class="list-news fl pt10 .*?">(.*?)<div class="list-news fl pt10 .*?">@s',$rs,$match);
Now this is result
[1] => Array
(
[0] => <div>Blue</div></div>
[1] => <div>Red</div></div>
[2] => <div>Black</div></div>
)
Result only show content in div <div class="list-news fl pt10 ">
and not get content in <div class="list-news fl pt10 alternative">
i can using str_replace for remove alternative
class but if don't replace this string, how can get all content in every div match class list-news fl pt10.*?
?
Thanks for idea.