I am trying to display just part of the retrived info from an API using curl.
Here is the code:
<?php
$post = [
'key' => 'fcee257155122a62dce9c75f4995db46',
'action' => 'balance'
];
$ch = curl_init('https://smmpanelserver.com/api/v2');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
// execute!
$response = curl_exec($ch);
// close the connection, release resources used
curl_close($ch);
// do anything you want with your response
var_dump($response);
?>
Here is the result:
string(40) "{"balance":"0.7287160","currency":"USD"}"
I want to display only:
0.7287160
How to do that?