I am learning how to use jQuery, $.post and php. (I am not a pro like you guys)
I want to send a multidimensional array to php.
My array looks something like this:
var item= new Array();
item[0] = ["Object", "Value"];
item[1] = ["id", "x"];
item[2] = ["status", "y"];
item[3] = ["date", "z"];
etc...
This is my jQuery code:
//AJAX
$("#add").click(function()
{
$.post( 'ajax_new.php' ,
{
item : item
},
function(data)
{
alert( data );
} //end: if:else
); //END:$.post
}); //END:ajax
Also, after posting the array, how do I handle it in php?
Like this?:
<?
$id = $_POST['item'][1][1];
echo $id;
?>