title: Remove stdClass objects from array
body: <p>I have a array like below (array 1) and I need to remove stdClass from it like in below array no. 2. Currently i'm doing it using a foreach loop, is there are better way to do that wthout looping?</p>
  
  <p><strong>Array no.1</strong> </p>
  
  <pre><code>array(3) {
    [0] =&gt; object(stdClass)#169 (4) {
      ["id"] =&gt; string(2) "59"
      ["name"] =&gt; string(13) "test"
      ["email"] =&gt; string(21) "abc@abc.com"
      ["telephone"] =&gt; string(20) "898998989"
    }
    [1] =&gt; object(stdClass)#190 (4) {
      ["id"] =&gt; string(2) "58"
      ["name"] =&gt; string(13) "test"
      ["email"] =&gt; string(21) "abc@abc.com"
      ["telephone"] =&gt; string(8) "71877858"
    }
    [2] =&gt; object(stdClass)#193 (4) {
      ["id"] =&gt; string(2) "34"
      ["name"] =&gt; string(9) "test"
      ["email"] =&gt; string(22) "abc@abc.com"
      ["telephone"] =&gt; string(13) "3189028092139"
    }
  }
  </code></pre>
  
  <p><strong>Array no.2</strong></p>
  
  <pre><code>array(3) {
    [0] =&gt; array(4) {
      ["id"] =&gt; string(2) "62"
      ["name"] =&gt; string(5) "test"
      ["email"] =&gt; string(22) "abc@abc.com"
      ["telephone"] =&gt; string(10) "898998989"
    }
    [1] =&gt; array(4) {
      ["id"] =&gt; string(2) "59"
      ["name"] =&gt; string(13) "test"
      ["email"] =&gt; string(21) "abc@abc.com"
      ["telephone"] =&gt; string(20) "71877858"
    }
    [2] =&gt; array(4) {
      ["id"] =&gt; string(2) "58"
      ["name"] =&gt; string(13) "test"
      ["email"] =&gt; string(21) "abc@abc.com"
      ["telephone"] =&gt; string(8) "3189028092139"
    }
  }
  </code></pre>
  
  <p>This is what I do (casting)</p>
  
  <pre><code>foreach($moderationContacts as $contact)
  {
      $contacts[] = (array)$contact;
  }
  </code></pre>