Php正则表达式结果错误


Php regular expression results error

我应该从这个网站得到价格,在这里我用PHP正则表达式和cUrl抓取。

URL = 'http://www.shopclues.com/lenovo-a526-with-1-year-physical-liquid-damage-cover-plus-insurance-refurbished.html';

$shopclues = get_page($url); 
if(preg_match('#<div class="price"><label>Deal Price:</label>(.*?)<'/div>#is', $shopclues,$b)) {
            $data['price'] = (float) str_replace(array(','),'',$b[1]);
        }
        elseif(preg_match('#<span id="sec_discounted_price_5713954">(.*?)<'/span><'/div>#is', $shopclues,$a))
        {
    $data['price'] = (float) str_replace(array(','),'',$a[1]);
        }

由这一行解决

$data['price'] = (float) str_replace(array('Rs.', ','),'',$b[1]);