Problem with fetching value out of foreach loop in php

I am having trouble fetching values from foreach loop. I always get NULL values when I try to send request in postman. Here is my code and what I have tried.

php code

$symbol = $request->symbol;
$ticker = $api->prices();

foreach ($symbol as $ticker => $pairname)
{
    echo $pairname;
}

in postman I send request like this

{
   "symbol":"BTCUSDT"
}

When I var_dump $ticker variable the response I get is as follows

array(147) {
["XRPBUSD"]=>
string(6) "0.5881"
["MKRUSDT"]=>
string(7) "2003.70"
["SRMUSDT"]=>
string(6) "2.2300"
["BTCUSDT"]=>
string(6) "37173.34" ... } and etc.

I need when I send symbol value in postman that it prints that value in foreach loop from that $ticker variable. Currently I get NULL value.