0
<?php
$array = ('1', '2', ... , '30000');
$return = myFunction($array); // max 200 elements for one query
foreach($return as $r){ //this must be call only one
//doSomething;
}
我有30000個元素的數組。我必須使用函數myFunction中的那些元素,但此函數對於一個查詢只能獲得最多200個元素。拆分表和組合
檢查此問題http://stackoverflow.com/questions/467149/what-is-the-max-key-size-for-an- array-in-php和http://stackoverflow.com/questions/5925885/php-array-size-limit – Rafee
你需要通過foreach的巨大數組並將這些元素存儲到幫助數組中 - 當你達到極限時你的函數,調用函數傳遞幫助數組作爲它的參數,並從空幫助數組重新開始...如果你需要結合數組(結果你的函數調用)使用[array_merge](http://cz2.php.net/manual/en/function.array-merge.php) –
@KamilŠrot是的,請添加新的答案 –