我插入了以下代码:
$counter = 1;
while($_POST['additional_contact1'] != '' || $_POST['additional_contact2'] != '' || $_POST['additional_contact3'] != '') {
if($_POST['additional_contact' . $counter] != '') {
$_SESSION['contact'][$counter]['additional_contact'] = $_POST['additional_contact' . $counter];
$_SESSION['contact'][$counter]['additional_int_prefix'] = $_POST['additional_int_prefix' . $counter];
$_SESSION['contact'][$counter]['additional_prefix'] = $_POST['additional_prefix' . $counter];
$_SESSION['contact'][$counter]['additional_first'] = $_POST['additional_first' . $counter];
$_SESSION['contact'][$counter]['additional_last'] = $_POST['additional_last' . $counter];
} else {
$_SESSION['contact'][$counter]['additional_contact'] = null;
$_SESSION['contact'][$counter]['additional_int_prefix'] = null;
$_SESSION['contact'][$counter]['additional_prefix'] = null;
$_SESSION['contact'][$counter]['additional_first'] = null;
$_SESSION['contact'][$counter]['additional_last'] = null;
}
$counter++;
}
我收到了这个错误:致命错误:允许的内存大小为 33554432 字节已用尽(试图分配 93 字节)
我尝试使用 ini_set() 增加内存限制,但它仍然无法在 96M 时工作。我的代码做错了什么使它需要这么多内存?我怎么解决这个问题?