I have this HTML code:
<span class="price">Price: <font class="rosu_12px_bold">2'099<sup>99</sup></font> EUR</span>
and i managed to extract the price: 2’09999
I cant catch the sup tag and insert a .
Now, in my database, i can only store real numbers
The value extracted is not a number so i get the 0 value, when trying to insert this value.
I can only insert it this way: 2099.99
I can never know what my extracted value looks like, so i need a solution to format it.
Try this:
Edit:
Remember this will replace period(.) as well.
Yet another edit: You can use strip tags to strip html tags
Edit:
But 99 between sup tags might denote the lower denomination of the currency may be 99 cents. In this case above example will not work.
Yet another edit,
Before using strip tags, you can replace sup tag with period(.) and then use strip_tags, if you want to maintain the lower denomination of the currency.
Hope this helps