How to increase number of iterations from within the loop in php? -


I am working on the custom pageing system and facing the following problem. When one of the elements is filtered from one set, then the size of the last array is smaller than the required. So I'm looking for a solution to increase the number of iterations from within the loop to get an array containing 50 elements.

  $ range = 50; // The number of elements that I want to get ($ x = 0; $ x & lt; $ limit; $ x ++) {if ($ elementIsNotFiltered) {// element Add to $ someArray; } And {// increase the number of iterations, so if some elements are filtered, then $ some array size will always be 50}}  

thanks for any help . / P>

Do this in a , while loop instead of () , and < Code> break when you finally press your $ limit


Comments