This is Data recovery from $_POST
$list =
array(0=>$_POST['matricule'],1=>$_POST['nom'],2=>$_POST['prenom'],3=>$_POST['dn'],4=>$_POST['tel'],5=>$_POST['mail'],6=>$_POST['sexe'],7=>$_POST['adresse']);
$contenu_json = json_encode($list);
fwrite($fp, $contenu_json); // "test.json"
And this Example result in test.json :
["123","test","test","test","test","test","test","test"]["2","test","test","test","","","",""]
Sample code 2:
$json_source = file_get_contents("test.json");
$data = json_decode($json_source, true);
echo '$data[1]';
Output $data[0] is "" :( . i want to see "123"
My objectif is to see all data json in form like :
<input name="id" type="text" value="<?= $data[0] ?>" >
what's the problem?