Please help me create json from this code , example
{
"results": [
{
"DASH": "fff72f33-e946-5945-b198-b405a652e078",
"DOGE": "600ea0a0-dff7-5bf5-8eb2-0b56c3ba5922",
}]}
Here is the php code I want to create this type of json response from it
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.jobians.top/coinbase/accounts.php?api=N7696pIFgkF7vagl&key=AF3RO2AIrhuLpw40kyEUnZcc975dRfQq",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET"
));
$response = curl_exec($curl);
curl_close($curl);
header('Content-Type: application/json');
$json2 = json_decode($response, true);
$id_array = array_map(function($el) { return $el['id']; }, $json2['data']);
foreach ($json2['data'] as $el) {
echo "{$el['balance']['currency']}: {$el['id']}\n";
}
?>
Please help me create json from this code
Please help me create json from this code