如何在ajax调用的客户端处理多个数组

I need to process 5 arrays in an AJAX call but only two are being decoded. I have been trying to debug this for one and a half days and I cannot work out why. I make the AJAX call with the following code

function postrates(){
  if(changearray.length>0){
     $.ajax({
        type:'POST',
        async:false,
        url:"xml_postdailyrate.php",
        data:{
           'changearray':JSON.stringify(changearray),
           'minarray  ':JSON.stringify(minarray),
           'lockarray ':JSON.stringify(lockarray),
           'costarray ':JSON.stringify(costarray),
           'availarray':JSON.stringify(availarray)
        },
        success:function(JSON){
           changearray=[];
           availarray =[];
           costarray  =[];
           minarray   =[];
           lockarray  =[];
        },
        error:function(){
           alert('Failed');
        }
     })
  }
}

It passes the arrays OK, the following server side code has been stripped down to make my testing easier.

<?php
   header("Content-Type: application/json");
   $changearray="Empty";
   $availarray="Empty";
   $minarray="Empty";
   $lockarray="Empty";
   $costarray="Empty";
   if(isset($_POST['changearray'])){
      $changearray=json_decode($_POST['changearray']);
   }
   if(isset($_POST['availarray'])){
      $availarray=json_decode($_POST['availarray']);
   }
   if(isset($_POST['minarray'])){
      $minarray=json_decode($_POST['minarray']);
   }
   if(isset($_POST['lockarray'])){
      $lockarray=json_decode($lock);
   }
   if(isset($_POST['costarray'])){
      $costarray=json_decode($_POST['lockarray']);
   }
   $arr['changearray'] =$changearray;
   $arr['availarray'] =$availarray;
   $arr['minarray'] =$minarray;
   $arr['lockarray'] =$lockarray;
   $arr['costarray'] =$costarray;
   $arr = json_encode($arr);
   echo("$arr");

Firebug "post" tab displays the 5 arrays correctly as

changearray [63291,63368,63292]
minarray    ["7","9","8"]
lockarray   ["X","X","X"]
costarray   ["4","6","5"]
availarray  ["1","3","222"]

The Firebug "JSON" tab displays

changearray [63291, 63368, 63292]
 0           63291
 1           63368
 2           63292
availarray  ["1", "3", "222"]
 0          "1"
 1          "3"
 2          "222"
minarray    "Empty"
lockarray   "Empty"
costarray   "Empty"

I cannot find out why it does not decode minarray, lockarray, costarray.

Thank you for taking the time to read my problem.

You aren't using the key "minarray", you are using the key "minarray " (note the spaces). The same for the other two arrays.