Problems with PHP when trying to create big array
问题 Here is my code, which creates 2d array filled with zeros, array dimensions are (795,6942): function zeros($rowCount, $colCount){ $matrix = array(); for ($rowIndx=0; $rowIndx<$rowCount; $rowIndx++){ $matrix[] = array(); for($colIndx=0; $colIndx<$colCount; $colIndx++){ $matrix[$rowIndx][$colIndx]=0; } } return $matrix; } $matrix = zeros(795,6942); And here is the error that I receive: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes) Any ideas how to solve this? 回答1