Substitute a phrase and characters from a result with simple html dom

SEOGuy

New Member
My code working good to result me an external part of the price of the item from an online store, but is loaded with standard html, css and letters, I wanna be just numbers without "," or "ABC" just numbers like "123". This is a part of external mobile-store site: \[code\]<div class="prod-box-separation" style="padding-left:15px;padding-right:15px;text-align:center;padding-top:7px;"> <div style="color:#cc1515;"> <div class="price-box"> <span class="regular-price" id="product-price-47488"> <span > <span class="price">2.443,<sup>00</sup> RON</span> </span> </span> </div> </div></div><div class="prod-box-separation" style="padding-left:10px;padding-right:10px;"> <style> .delivery { display:block; } </style> <p class="availability in-stock"> <div class="stock_info">Produs in stoc</div> <div class="delivery"><div class="delivery_title">Livrare(in timpul orelor de program):</div> <div class="delivery_item">Bucuresti - BANEASA : imediat</div> <div class="delivery_item">Bucuresti - EROILOR : luni dupa ora 13.00.</div> <div class="delivery_item">CURIER : Marti</div> </div> </p>\[/code\] Garan?ie: 12 luni Here is my actual code:\[code\]<?phpinclude_once('../simple_html_dom.php');$dom = file_get_html("http://www.site.com/page.html");// alternatively use str_get_html($html) if you have the html string already...foreach ($dom->find('span[class=price]') as $node){echo $node->innertext;} ?> \[/code\]and my result is this: \[code\]2.443,<sup>00</sup> RON\[/code\] But correct result will be: \[code\]2.443\[/code\] or \[code\]2443\[/code\]
 
Back
Top