I have to extract array from html block , specifically just the tools (without the word tools and the match need to be no greedy), the problem is the html block takes two forms, once it's like this:
<p>tools :<br>
1 Hex Key (or two Hex key)<br>
1 screww drivers<br>
1 hammer <br>
1 drill </p>
and the second form is like this:
<p>"tools :
1 Hex Key (or two Hex key)
1 screww drivers
1 hammer
1 drill "</p>
i try with this regex , but i don't succeed:
$tools = "<p>tools :<br>
1 Hex Key (or two Hex key)<br>
1 screww drivers<br>
1 hammer <br>
1 drill </p>"
$tools_array = preg_match_all('#<p>tools:([^<>]*<br\s*/?>[^<>]*)+</p>#s',
$tools);
Any idea ?