All I want is to read from an external source 2 prices, minimum price and maximum one.
This is the external source:
<p class="mb_05 magnify_price_stores"><span>
<span class="txt_price_gray">429,11 RON</span> - <span class="txt_price_gray">678,50 RON</span>
</span> <span><span class="gray">(de la <b>50</b> magazine)</span></span></p>
I am using this code:
function emag() {
$dom1 = file_get_html("http://www.shopmania.ro/telefoane-mobile/p-samsung-galaxy-y-duos-s6102-25140344");
foreach ($dom1->find('span [class=txt_price_gray]') as $node)
{
$result = $node->innertext;
$price = explode("RON", $result);
$prices[] = $price[0];
echo "$prices[0]";
}}
emag()
And I am getting this: 429,11 429,11
on $prices[0]
and 678,50
on $prices[1]
$prices[0]
is double!