Hello everyone. I'm a self learner that is very new to programming. I'm trying to print out the value of ["mid"] from a json_decode variable in the code shown below:
I'm trying to use for each to access the value of "mid'. using foreach function. I know I'm not doing it the right way. please help me or show me an easy was to go around it.
/////the json resopnd form the url is :
{"terms":"http://www.xe.com/legal/dfs.php","privacy":"http://www.xe.com/privacy.php","from":"USD","amount"
If you
echo '<pre>$json = ', print_r($json, 1), '</pre>';
you get
$json = Array
(
[terms] => http://www.xe.com/legal/dfs.php
[privacy] => http://www.xe.com/privacy.php
[from] => USD
[amount] => 1.195
[timestamp] => 2021-02-09T16:52:00Z
[to] => Array
(
[0] => Array
(
[quotecurrency] => NGN
[mid] => 454.6559871014
)
)
)
T