title: PHP: going through an non ordered index multidimensional array
body: <p>I have the following array:</p>
  
  <pre><code>$users
  : array = 
    0: array = 
      0: object(Person) = 
        strName: string = John
        strLastName: string = Smith
        strAge: string = 19
      1: object(Person) = 
        strName: string = Jean
        strLastName: string = Newton
        strAge: string = 22
    1: array = 
      0: object(Person)= 
        strName: string = John
        strLastName: string = Smith
        strAge: string = 19
      1: object(Person) = 
        strName: string = Jean
        strLastName: string = Newton
        strAge: string = 22
    2: array = 
      0: object(Person) = 
        strName: string = Martin
        strLastName: string = Marin
        strAge: string = 25    
  </code></pre>
  
  <p>In order to get rid of the duplicates I’ve done: </p>
  
  <pre><code>$users = array_map("unserialize", array_unique(array_map("serialize", $users)));
  </code></pre>
  
  <p>And I get: </p>
  
  <pre><code>$users
  : array = 
    0: array = 
      0: object(Person) = 
        strName: string = John
        strLastName: string = Smith
        strAge: string = 19  
      1: object(Person) = 
        strName: string = Jean
        strLastName: string = Newton
        strAge: string = 22  
    1: array = 
      0: object(Person) = 
        strName: string = Martin
        strLastName: string = Marin                                                                                                        
        strAge: string = 25   
  </code></pre>
  
  <p>Now I have to get the info the array contains. 
  I’m doing: </p>
  
  <pre><code>$i=0;
  foreach ($users as $u)
  {
    echo $u [$i]-&gt;getName()); 
  .
  .
    $i++;
   }
  </code></pre>
  
  <p>But I’m not printing all the elements of the array, $u [2] is NULL. </p>
  
  <p>What I’m I doing wrong?</p>
  
  <p>Thanks a ton!  </p>