Ajax Post:已发布的Object数组,无法在php端检索

"company=1&cat=3&cat=1"

my Javascript object "cat" have two values 1,3 and

var cat = [];
cat.push(1);
cat.push(2);

now i want post it to servr using AJAX , I am able to post the data

and I can see data appearing in PHP side but my problem is

when I capture posted data in php it is only showing one value of cat

actual data = company=1 , cat= [1,3];

here is my posted query = company=1&cat=3

this is what PHP print_r showing =

 Array
(
    ["company] => 1
    [cat] => 3
    "
)

as you can see , the cat value is only one value instea of array (1,3)

what i am missing here ...

You can use [] to pass an array. Your url should become like:

"company=1&cat[]=3&cat[]=1"

Then $_GET['cat'] will return array(3,1);