title: PHP : Remove object from array
body: <p>What is an elegant way to remove an object from an array of objects in PHP ?</p>
  
  <p>Just to be clear ..</p>
  
  <pre><code>class Data{
  
    private $arrObservers;
  
    public add(Observer $o) {  
      array_push($this-&gt;arrObservers, $o);  
    }    
    public remove(Observer $o) {  
      // I NEED THIS CODE to remove $o from $this-&gt;arrObservers
    }  
  
  }
  </code></pre>