title: Unset variable(s) for each array object
body: <p>I'd like to know if there is any way to simplify this:</p>
  
  <pre class="lang-php prettyprint-override"><code>$transactions = $database-&gt;fetchAll("SELECT * FROM transactions WHERE user = :user", array(":user" =&gt; $USER["id"]));
  $transactions_cleaned = array();
  
  foreach($transactions as $transaction){
      unset($transaction["id"]);
      unset($transaction["user"]);
  
      array_push($transactions_cleaned, $transaction);
  }
  </code></pre>
  
  <p>It basically removes each <code>id</code> and <code>user</code> variables for each object of the following array:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 1
              [user] =&gt; 1
              [type] =&gt; deposit
              [amount] =&gt; 1000
          )
      [1] =&gt; Array
          (
              [id] =&gt; 2
              [user] =&gt; 1
              [type] =&gt; withdraw
              [amount] =&gt; 1000
          )
  )
  </code></pre>
  
  <p>So it becomes like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [type] =&gt; deposit
              [amount] =&gt; 1000
          )
      [1] =&gt; Array
          (
              [type] =&gt; withdraw
              [amount] =&gt; 1000
          )
  )
  </code></pre>