I'm fetching data through CURL request and while parsing the HTML I'm some spans having attributes are not being parsed neatly.
Snippet of HTML code
<div class="ftlt" style="width:250px;">
<div class="tdiv"><span class="prop_price_img"></span><span class="property_price">PROPERTY_PRICE</span></div>
<p class="adPrice">AREA</p>
<h4>
<p style="float:left;width:251px;font-family:Arial, Helvetica, sans-serif;font-size:13px;padding:2px 10px 10px 0px;"><a href="some link" title="title">TITLE</a>,
<span style="color:#666;"> CITY_NAME.</span>
<a title="title, Sale" style="color:#3266CC;font-size:12px;text-decoration:underline;">View on map</a></p>
</h4>
<p style="font-weight:bold;color:#666;">
Premium
</p>
<div class="clr"></div>
</div>
I have to access the CITY_NAME element neatly. I have been able to fetch that node through HTML DOM as
$spans = $html->find(div.ftlt span);
$city_value=strip_tags($spans[2]);
This $city_value
is getting morphed.
I've tried removeAttribute method.Maybe I'm not doing it properly.
If regex can be applied, I want to know how?