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;
}

i have array with 30000 elements. I must use there elements in function myFunction, but this function can get only max 200 elements for one query.

  • 2
    check this http://stackoverflow.com/questions/467149/what-is-the-max-key-size-for-an-array-in-php and http://stackoverflow.com/questions/5925885/php-array-size-limit – Rafee Oct 31 '12 at 14:01
  • You would need to go thru the huge array with foreach and store the elements into help array - when you reach the limit of your function, call the function passing help array as argument to it and start over with empty help array... if you need to combine arrays (results of your function calls) use [array_merge](http://cz2.php.net/manual/en/function.array-merge.php) – Kamil Šrot Oct 31 '12 at 14:10
  • @KamilŠrot yes, please add new answer – Ted Hoowkings Oct 31 '12 at 14:13

1 Answers1

0

You would need to go thru the huge array with foreach and store the elements into help array - when you reach the limit of your function, call the function passing help array as argument to it and start over with empty help array... if you need to combine arrays (results of your function calls) use array_merge

Kamil Šrot
  • 2,141
  • 17
  • 19