php return json
header('Content-type: application/json');
echo json_encode($array);
php return json
header('Content-type: application/json');
echo json_encode($array);
php json request get value of an array element
<?php
$jsonurl = "https://reqres.in/api/users?page=2";
$json = file_get_contents($jsonurl);
$jsonDecode = json_decode($json, true);
var_dump($jsonDecode['data']);
foreach($jsonDecode['data'] as $mydata){
echo $mydata['email'] . "<br>";
}
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us