php sort urls by ip addresses
<p>Ok I posted before a question that was not so clear, so let me try again. 
I am trying to organize my websites into batches of 5 sites per batch that all have different ip addresses. </p>

<p>To do so I must, get IP on-the-fly for each url and then organize them, the sites, into batches of 5 sites per batch, that each have there own unique IP address. </p>

<p>If I have multiple IP address they must be shown on the next batch.</p>

<p>Can anyone help my out with this issue ?  </p>

<p>I have the an array with sites and there IP.</p>

<p>Here is my code : </p>

<pre><code>if(isset($Organize_List)){
 $List =   explode("\n", $Organize_List);
$IP_Array = array();
      foreach($List as $SIte){
    $Ip = gethostbyname(trim($SIte));
      if(preg_match('/^\d+$/', $Ip[1])){
         $IP_Array[$Ip][] = $SIte.'&lt;br /&gt;';
                }
 }
</code></pre>

<p>Now here is where it get's tricky. </p>

<p>My problem is how to <strong>organize them into batches of 5 sites per batch, that each have there own unique IP address.</strong></p>
