1

how to get value from array in php from api here is my code

 $data = callBitAPI('GET','https://min-api.cryptocompare.com/data/pricemultifull?fsyms='.strtoupper($bc->slug).'&tsyms=USD');

        if(!empty($data)){

            $data = json_decode($data,true);
          //  echo '<pre>';
          // print_r($data);
            $data = getRelevantCryptoArray($data,$bc->slug);


        }

and here is my result Please see Attachment http://prntscr.com/k7hawi

doctorlove
  • 18,872
  • 2
  • 46
  • 62

2 Answers2

1

Um... simply

$price = $data['RAW']['BTC']['USD']['PRICE'];
print_r($price);

unless I'm missing something?

AKX
  • 152,115
  • 15
  • 115
  • 172
0

dd($data['RAW']['BTC']['USD']['PRICE']) and see the result