post json array via jquery.post?
After a series of attempts working on json, now I have another challenge - How can post this type of json array,
[{"success":true,"filename":"agard.jpg"}]
jquery.post,
$.post("process.p开发者_开发百科hp", json ,function(xml){
});
So I can get this array in process.php using print_r($_POST)
:
Array
(
[success] => true
[filename] => agard.jpg
)
You need to pass an object not an array, you can put the array in your object though.
{"0":[{"success":true,"filename":"agard.jpg"}]}
精彩评论