Hello If i want this text:
$content = '<div id="hey">
<div id="bla"></div>
</div>
<div id="hey">
hey lol
</div>';
The content inside the id="hey" can be changed.
And now I want to get the tags in array$array[0] = < div id="bla"></div >; $array[1] = < hey lol >;
How Can I do that? i though about preg_match_all?
id... that's bad. Maybe you're looking to useclassinstead? Second, you could use a regular expression, but since HTML is not a regular language, regular expressions are not ideal. How are you generating these strings, and could you accomplish what you need done some other way? We need more context. Furthermore, I don't even think your example array makes sense, and matching a div inside another one could get wonky.