通过ajax将数组发送到php

I am sending array via ajax to PHP. How to get the array from PHP?

$('.send-image').on('click', function() {
    $.ajax({
        type:"POST",
        url:"sendimages.php",
        data: {
            images: imgArr
        },
        success: function(data) {
            console.log(data);
        },
        error: function(e) {
            console.log(e);
        }
    });
});

I tried with this, but its not working

$images = $_POST['imgArr'];
foreach($images as $d) {
    echo $d;
}

Replace

$images = $_POST['imgArr'];

With

$images = $_POST['images'];

Because the index images came from here:

data: {
    images: imgArr
}