title: Stop looping and output and then continue php
body: <p>Ok, I think its time to ask here for my script now,</p>
  
  <p>I have a large array and I want to loop it and then stop it when it comes to a certain amount and then continue to loop, here is a sample of the script,</p>
  
  <pre><code>$result_array = array();
  $locations = //array of locations coming from a XML SOAP respond;
  
  foreach($locations as $loctn){
      //Request of the XML,
      $result = //A large array coming from a XML SOAP respond;
  
      foreach($result as $val){
          $result_array[] = 'somkey' =&gt; $val-&gt;identifcator,
                            'somkey1' =&gt; $val-&gt;language,
                            'somkey2' =&gt; $val-&gt;textSubjectQualifier,
                            'somkey3' =&gt; $val-&gt;companyId,
                            //etc.
      }
  }
  
  print_r($result_array);
  </code></pre>
  
  <p>So the first array is from a XML respond and I loop it again with the locations and its requesting again from the XML and I loop it again into a different array and then I want to output the last array outside the loop,</p>
  
  <p>But I'm having trouble here because its a very large array, and if the array not so big it comes out good but when I want to make it bigger then I got no result because the browser stops it,</p>
  
  <p>I tried to play around with the memory but its not solving my problem so I guess the best way would be I should stop the array and then output it and then continue looping, but I don't know how to do it,</p>
  
  <p>Please help me out with it</p>
  
  <p>Thank you</p>