php return json
header('Content-type: application/json');
echo json_encode($array);
php return json
header('Content-type: application/json');
echo json_encode($array);
fetch value from json link in php
$ch = curl_init();
// IMPORTANT: the below line is a security risk, read https://paragonie.com/blog/2017/10/certainty-automated-cacert-pem-management-for-php-software
// in most cases, you should set it to true
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'url_here');
$result = curl_exec($ch);
curl_close($ch);
$obj = json_decode($result);
echo $obj->access_token;
how to receive json data in php
$data = json_decode(file_get_contents('php://input'), true);
print_r($data);
echo $data;
how to get data from json array in php
$data = json_decode($json);
return json in php
//code igniter
$query="qry";
$query = $this->db->query($query);
$res=$query->result();
return json_encode($res);
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