first of all i have to tell that i'm completly new to php coding and JSON format.
Hi have data from my app to write on my server, to do this i'm using JSON.
When the app starts for the first i make my request for the server to create the JSON file with empty attribute. The file looks like this :
{"dicHistoriqueCours":[],"dicHistoriqueDevoir":[],"dicHistoriqueInterroDone":[],"dicHistoriqueInterroCorrigee":[]}
if i want to add an attribute into this file i can do this using :
$jsonContent = json_decode($content,true);
$dicCurrentContent['dic'] = $currentDic;
This code adds an attribute into my JSON File, that's fine but what i want to do is do add $currentDic into one of my attribute (dicHistoriqueCours)
To do that i use :
$jsonContent = json_decode($content,true);
$dicCurrentContent = $jsonContent['dicHistoriqueCours'];
$dicCurrentContent['dic'] = $currentDic;
It gave me nothing, i've tried multiple solutions all night long, can someone help me ?
Thank you very much.