title: how to get array like this?
body: <p>I have one array in php like this :</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
      (
          [name] =&gt; abc
          [id] =&gt; 107            
          [CycleNumber] =&gt; 1
          [Type] =&gt; People
      )
      [1] =&gt; Array
      (
          [name] =&gt; john
          [id] =&gt; 312         
          [CycleNumber] =&gt; 5
          [Type] =&gt; People
      )
      [2] =&gt; Array
      (
          [name] =&gt; jenny
          [id] =&gt; 110        
          [CycleNumber] =&gt; 3
          [Type] =&gt; People
      )
      [3] =&gt; Array
      (
          [name] =&gt; metting room
          [id] =&gt; 590 
          [CycleNumber] =&gt; 4
          [Type] =&gt; Facility
      )
      [4] =&gt; Array
      (
          [name] =&gt; projector
          [id] =&gt; 470    
          [CycleNumber] =&gt; 4
          [Type] =&gt; Facility
      )
  
   )
  </code></pre>
  
  <p>I want to replace the duplicate type with blank. but the first one should have that type name and others should have blank. so the result array should be like this :</p>
  
  <pre><code> Array
   (
      [0] =&gt; Array
      (
          [name] =&gt; abc
          [id] =&gt; 107            
          [CycleNumber] =&gt; 1
          [Type] =&gt; People
      )
      [1] =&gt; Array
      (
          [name] =&gt; john
          [id] =&gt; 312         
          [CycleNumber] =&gt; 5
          [Type] =&gt; 
      )
      [2] =&gt; Array
      (
          [name] =&gt; jenny
          [id] =&gt; 110        
          [CycleNumber] =&gt; 3
          [Type] =&gt; 
      )
      [3] =&gt; Array
      (
          [name] =&gt; metting room
          [id] =&gt; 590 
          [CycleNumber] =&gt; 4
          [Type] =&gt; Facility
      )
      [4] =&gt; Array
      (
          [name] =&gt; projector
          [id] =&gt; 470    
          [CycleNumber] =&gt; 4
          [Type] =&gt; 
      )
  
   )
  </code></pre>
  
  <p>I want array in this format only. and i am using PHP zend.</p>
  
  <p>I search for this but most of them showing to remove that element from array. but i don't want to remove it. i want to replace it with blank but want to show the first one.</p>
  
  <p><strong>Tried Code</strong></p>
  
  <pre><code>$result = array(); 
  $result1 = array(); 
  $result2 = array(); 
  $y = array(); 
  $y1 = array(); 
  foreach ($data as $entry) {  
      $type= $entry["type"]; 
      if (!isset($y[$type])) {
          $y[$type] = array(); 
          unset($entry["type"]);   
          $result[$type][] = $entry;   
      }
  } 
  </code></pre>
  
  <p>can anyone tell me how to do that ?</p>