How to get json object from client to php array on server?

I want to fill a 2D array in php from a JSON object in javascript on the client. Can someone help me make this functionality?

+4
source share
2 answers

Head to head, knowing nothing about your code

you can use json_decode

use it as follows:

$array = json_decode($_POST['data'], true); #check the second parameter set to true, otherwise you will get a stdclass. 
+3
source

All Articles