title: Need to send notification in a batch of 1000
body: <p>I have created notification application , now i want to send notification to batch of 1000 users, but as i am new i dont know how to create that batch.</p>
  
  <p>this is my code to push notification.</p>
  
  <pre><code>&lt;?php
  include('header.php');
  
  define( 'API_ACCESS_KEY', '[API-KEY comes here]' );
  
  $sql="SELECT * FROM user_data";
  $result = mysqli_query($conn, $sql) or die ('Error'.mysqli_error($conn));
  $registrationIds=array();
  while($row=mysqli_fetch_assoc($result)){
  
      $registrationIds[] = $row['allow'];
  }
  $ids=json_encode($registrationIds);
  $fields = array
  (
      'registration_ids'  =&gt; $registrationIds
  );
  
  $headers = array
  (
      'Authorization: key=' . API_ACCESS_KEY,
      'Content-Type: application/json'
  );
  
  $ch = curl_init();
  curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
  curl_setopt( $ch,CURLOPT_POST, true );
  curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
  curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
  curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
  curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
  $result = curl_exec($ch );
  curl_close( $ch );
  
  echo $result;
  
  
  ?&gt;
  </code></pre>
  
  <p>Now i can push notification on to users but how can i send notification in batch of 1000 if i have 10000  users?</p>