Json Apiyi Html Çevirme (1 Viewer)

Joined
Apr 18, 2022
Credits
2,380
Rating - 0%
<?php function parse_data(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://randomuser.me/api?nat=TR'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $source = curl_exec($ch); curl_close($ch); $data = json_decode($source,true); $main_arr = $data["results"][0]; //burada hangi degeri almak istiyorsan kendine gore ayarlar, donersin. ornek; return $main_arr["name"]["first"]." ".$main_arr["name"]["last"]; } echo parse_data();
 

Users who are viewing this thread

Top