From the following HTML code that does not have a specific structure but are just plain , how can I get the: (below you can find what I did using regex)
- 231435424
- 1800cc
- 163bhp
- Automatic
- Petrol
- Blue
Here is the HTML code
<td class="details">
<a href="./view/3505089/"><span class="p_t">Audi A4</span></a>
<a class="info" href="./view/3505089/">(Details)</a><br>
<div class="attribs">
Roadster
<br>
P.O: 35562, <span class="p_l">BURON</span>, Phone. 231435424<br>
1800cc,
163bhp,
Automatic,
Petrol,
Blue,
</div>
</td>
Here is what I was doing with regex
$bhps = array();
$gears = array();
preg_match_all('/(\d{2,3})bhp\b,/', $str2b, $bhps);
preg_match_all('#(A(.*?)tomatic|Ma(.*?)ual)#u', $str2b, $gears);
foreach .......
$bhp = $bhps[1][$key];
$gear = $gears[1][$key];
........