i have json file with array and i want to add array elemnts to that array using php . please advice me to proceed.
here is my existing json file
data.json
{
"12":{"userId":"1","username":"Ss","password":"33"},
"32":{"userId":"1","username":"Ss","password":"33"}
}
my php file
below is my code part which i need to append with my existing json file.
$data[$thisId] = array(
'userId'=> $userId,
'username'=> $username,
'password'=> $password,
);
$json = json_encode($data);
how can i add this to my json file ? pls advice
: I want to write the data which come from php file into my existing json file