using stringify

using stringify

I am trying to pass two arrays to a php page like this:
  1. var mainFilter = getAllMainCheckedCheckboxesVals();
                                var subFilter = getAllSubCheckedCheckboxesVals();
                                JSON.stringify(mainFilter);
                                JSON.stringify(subFilter);
                                $.ajax({ url: 'process.php',
                                data: { mainFilter : mainFilter, subFilter : subFilter},
                                type: 'post',
                                success: function(output) {
                                        if(output){
                                            alert(output);
                                        }
                                    }
                                });

When I do this, all I get is the response, "Array".  Here is my PHP code:

  1. $mainFilter=$_POST['mainFilter'];

    if($mainFilter){
        echo $mainFilter;
    }

Shouldn't the arrays be in a string format?