samedi 19 mai 2018

I got the json data from the url and I need to print the json data in my laravel 5.6 view

Trying to print the json data in my laravel5.6 view using controller. I got an error Illegal string offset 'rates'

My Controller Code

 $req_url = 'https://v3.exchangerate-api.com/bulk/6eea6e74c3abe1df9de390c2/USD';
 $response_json = file_get_contents($req_url);
 $configdata4   = json_encode($response_json);
 $final_data4 = json_decode($configdata4,true);
 return view('clientlayout.main.registerdomain',compact('final_data4'));

My view page Code

@foreach($final_data4['rates'] as $value)

@endforeach

Please suggest any solutions to this issue.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire