Answers for "jquery post json php and get response"

PHP
1

ajax post json data handle in php

// sent json data by post method or others
// {"id":"2"}

header('Content-Type: application/json'); 
// retrieve json data from post 
$json = file_get_contents('php://input'); // return {"id":"2"}
$data = json_encode($json); // return a stdClass object| $data->id
echo $data->id;
Posted by: Guest on October-25-2021
-1

how to make a json request in php

<?php
$jsonurl = "http://api.wipmania.com/json";
$json = file_get_contents($jsonurl);
var_dump(json_decode($json));
?>
Posted by: Guest on April-26-2020

Code answers related to "jquery post json php and get response"

Browse Popular Code Answers by Language