Hi,
Below is the data format which I am passing to php via javascript in json format.
{"name":"Secret","value": "checked","name":"OldSpice","value": "unchecked","name":"Degree","value": "unchecked","name":"Dove","value": "unchecked","name":"Axe","value": "unchecked","name":"Maxim","value": "unchecked","name":"Nivea","value": "unchecked",}
I can access the data successfully using the code
echo $_POST['name'];
I want to convert it to an array. I tried to use json_decode() and below is my code but I am getting the below error and I don't know what to do.
$obj = json_decode($_POST);
echo $obj;
Warning: json_decode() expects parameter 1 to be string, array given
Any help will be highly appreciated.
Cheers,
Vishal