我遇到了一个问题,无法确定以下 $_POST 请求的问题所在。问题是我通过 AJAX 提交了一个包含 855 条记录的数组,但我的 AJAX 控制器只接收到了 833 条记录。总是接收到相同的记录,并且总是在同一点截断:
JQuery:
var f = {};
f.chargeID = chargeID;
f.method = 'saveIndividualApplications';
f.individualAmounts = individualAmts;
processing.show();
console.log(f); //all records present
console.log(Object.keys(f.individualAmounts).length); //855
return $.ajax({
type: 'post',
cache: false,
url: appControllerPath,
data: f
});
PHP控制器:
$displayMaxSize = ini_get('post_max_size'); //125912
file_put_contents('post', $_SERVER['CONTENT_LENGTH'] . "\r\n"); //240M (increased this to 240 just to check)
file_put_contents('post', $displayMaxSize . "\r\n", FILE_APPEND);
file_put_contents('post', print_r($_SERVER, true), FILE_APPEND);
file_put_contents('post', count($_POST['individualAmounts']) . "\r\n", FILE_APPEND); //833
file_put_contents('post', print_r($_POST['individualAmounts'], true), FILE_APPEND); // data cuts off midway through 833rd record (although the array seems to close fine)