Displaying price in BTC based on USD exchange rate
Save the code to a PHP file in the web directory: 

&lt;?php  
  $url = "https://bitpay.com/api/rates";

  $json = file_get_contents($url);
  $data = json_decode($json, TRUE);

  $rate = $data[2]["rate"];   //$data[1] is outdated now, they have updated their json order. This new number 2 now fetches USD price. 
  $usd_price = 10;     # Let cost of elephant be 10$
  $bitcoin_price = round( $usd_price / $rate , 8 );
?&gt;

&lt;ul&gt;
   &lt;li&gt;Price: &lt;?=$usd_price ?&gt; $ / &lt;?=$bitcoin_price ?&gt; BTC
&lt;/ul&gt;