Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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;
 
PREVIOUS NEXT
Tagged: #ajax #post #json #data #handle #php
ADD COMMENT
Topic
Name
6+2 =