<?php
$myArr = array(
"Name" => "Ambiorix",
"Lastname" => "Rodriguez",
"age" => 35,
"ocupation" =>array('lawyer','IT Manager')
);
//array to json
$myJSON = json_encode($myArr);
echo $myJSON;
echo "<br>";
//json to array
print_r(json_decode($myJSON,true ));
No hay comentarios:
Publicar un comentario