preg_match_all et mono-ligne
Bonjour,
Je souhaiterai récupérer les valeurs des "style" de mon code html suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <div class="ConteneurModule">
<div style="float:left; padding:5px; width:242px; font-size:13px; color:#666;">gfdgdf</div>
<div style="float:left; width:252px; border-top:solid 1px #E8E8E8; border-bottom:solid 1px #E8E8E8;">
<div style="float:left; width:50px; border-right:solid 1px #E8E8E8; padding:5px 10px 5px 10px;">
<div style="float:left; width:50px; font-size:13px; font-weight:bold;">166</div>
<div style="float:left; width:50px; font-size:11px; color:#666;">gbdf</div>
</div>
<div style="float:left; width:161px; padding:5px 10px 5px 10px;">
<div style="float:left; width:161px; font-size:13px; font-weight:bold;">2</div>
<div style="float:left; width:161px; font-size:11px; color:#666;">bjsfdbk</div>
</div>
</div>
</div> |
Pour cela j'utilise
Code:
preg_match_all('#\<div.*style\="(.*)".*\>#im', $html, $tab1);
Ce qui fonctionne très bien si il n'y a pas 2 style sur la même ligne.
Si je mets mon html en une seule ligne il me récupère uniquement le dernier "style"...
des idées ?
Merci