$s = 'HTTP/1.1 200 OK Server: nginx Date: Fri, 24 Jun 2016 00:12:40 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 181 Connection: keep-alive Keep-Alive: timeout=120 Vary: Accept-Encoding Cache-Control: no-cache {"account":"789797078","balance":0.00,"currency":"643","identified":false,"account_type":"personal","account_status":"named","balance_details":{"total":0.00,"available":0.00}}';
preg_match('/^HTTP\/\d+\.\d+\s+(\d+)/', $s, $r);
$code = $r[1];
preg_match('/"balance":([\d\.]+)/', $s, $r);
$balance = $r[1];
echo($code.' '.$balance);