“Ajax Post JSON DATA DIA” Respostas de código

PHP Return JSON Data to Ajax

header('Content-Type: application/json'); 

$colors = array("red","blue","green");
echo json_encode($colors);
Grepper

Ajax Post JSON DATA DIA

// 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;
Dev Arman

Resposta Php Json ao Ajax


<?php
 echo json_encode($data);
?>

Yellowed Yacare

Respostas semelhantes a “Ajax Post JSON DATA DIA”

Perguntas semelhantes a “Ajax Post JSON DATA DIA”

Mais respostas relacionadas para “Ajax Post JSON DATA DIA” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código