“JSON Encode” Kode Jawaban

PHP Echo Json

<?php
$data = ['name' => 'John', 'age' => 35];
header('Content-type: Application/json');
echo json_encode($data);
ArtesanoMultimedia

JSON Enum String

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

[JsonConverter(typeof(StringEnumConverter))]
public Gender Gender { get; set; }
Unsightly Unicorn

php json_encode

$person = array( 
    "name" => "Johny Carson", 
    "title" => "CTO"
); 
$personJSON=json_encode($person);//returns JSON string
Grepper

JSON Encode

$json = '{"a":1,"b":2,"c":3}';
var_dump(json_decode($json)); //converts json to array

$array = [ "a" => 1, "b" => 2, "c" => 3];
echo json_encode($json_encode($json)); //converts array to json
Armandres

Jawaban yang mirip dengan “JSON Encode”

Pertanyaan yang mirip dengan “JSON Encode”

Lebih banyak jawaban terkait untuk “JSON Encode” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya