'Didn't work convert JSON decoded string to array in PHP which is send by Ajax method
I have JS object
data=[{'quest':'sometext'},{'option':['a','b', 'c']}, {'cor':[0,1,0]},{'sol':'again tetx'}]
Submited as Ajax data using JQuery
... data:{'qs':JSON.stringify(data)}, ...
I received the as post and try to convert to array
$array=json_decode(json_encode($_POST['qs']), true);
but output is
print_r($array); \\is
[{"quest":"sometext"},{"option":["a","b", "c"]}, {"cor":[0,1,0]},{"sol":"again tetx'}]
I want to make it array in PHP
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|