How to use BlockChain API?
Your code is close to what you need:

&lt;?php

$guid="xxxxxxxxx";
$main_password="xxxxxxxxx";

$json_url = "https://blockchain.info/merchant/$guid/balance?password=$main_password";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$balance = $json_feed-&gt;balance;

echo $balance;
?&gt;


The response looks like this (Wallet Balance in Satoshi):

{ "balance": 1000}


So you need to fetch the balance object not the message one.
Then add an echo to print out the balance.