I grabbed value of silver from yahoo finance and added 0.10 to the current value.. it is showing right result..

```
$yql_base_url = "http://query.yahooapis.com/v1/public/yql?";

$params = array(
    'q'      => 'select * from html where url=@url and xpath=@xpath;',
    'url'    => 'http://finance.yahoo.com/q?s=XAGUSD%3DX&ql=1',
    'xpath'  => '//*[@id="yfs_g00_xagusd=x"]',
    'env'    => 'http://datatables.org/alltables.env',
    'format' => 'json',
);

$yql_query_url = $yql_base_url . http_build_query($params);

$session = curl_init($yql_query_url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$json   = curl_exec($session);
$phpObj = json_decode($json);

if ($phpObj->query->count > 0) {
    $price = $phpObj->query->results->span->content;
}
?>
<div>  <?php echo $price; ?> which is current value </div>
<div><?php echo $price + .10; ?> where 0.10 is added</div>

```

**[click to Run the code here](http://codepad.viper-7.com/gyayWd)**

But when i try that for gold price , the result shows wrong output ie 1 or 2

```
$yql_base_url = "http://query.yahooapis.com/v1/public/yql?";

$params = array(
    'q'      => 'select * from html where url=@url and xpath=@xpath;',
    'url'    => 'http://finance.yahoo.com/q?s=XAUUSD%3DX&ql=1',
    'xpath'  => '//*[@id="yfs_g00_xauusd=x"]',
    'env'    => 'http://datatables.org/alltables.env',
    'format' => 'json',
);

$yql_query_url = $yql_base_url . http_build_query($params);

$session = curl_init($yql_query_url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$json   = curl_exec($session);
$phpObj = json_decode($json);

if ($phpObj->query->count > 0) {
    $price = $phpObj->query->results->span->content;
}
?>
<div> <?php echo $price; ?> which is current value</div>
<div> <?php echo $price + .10; ?> where 0.10 is added</div>

```

**[Click to run the code here](http://codepad.viper-7.com/6XyP65)**

Can anyone please help me in this matter.. any suggestions