Answers for "php perbedaan json_encode dan json_decode"

PHP
20

php json_decode

$personJSON = '{"name":"Johny Carson","title":"CTO"}';

$person = json_decode($personJSON);

echo $person->name; // Johny Carson
Posted by: Guest on July-01-2019
0

json encode decode php

$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
Posted by: Guest on April-07-2022

Browse Popular Code Answers by Language