php - Using a technick how can I get the following that they do not have any specific structure? -


from following html code not have specific structure plain , how can the: (below can find did using regex)

  1. 231435424
  2. 1800cc
  3. 163bhp
  4. automatic
  5. petrol
  6. blue

here 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 doing 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];     ........ 


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -