removing array from multidimensional array
<p>Hello i hav e a session that looks like this:</p>

<pre><code>array(3) {
  ["counter"]=&gt;
  int(0)
  ["currentItem"]=&gt;
  string(1) "2"
  ["addedToCart"]=&gt;
  array(12) {
    [0]=&gt;
    array(11) {
      ["aantal"]=&gt;
      int(1)
      ["id"]=&gt;
      string(1) "1"
      ["filmtitel"]=&gt;
      string(11) "a_bugs_life"
      ["film_id"]=&gt;
      string(1) "2"
      ["zaal_id"]=&gt;
      string(1) "1"
      ["zaaltitel"]=&gt;
      string(6) "zaal 1"
      ["tijdstip"]=&gt;
      string(8) "15:00:00"
      ["stoeltjes"]=&gt;
      string(2) "21"
      ["dag"]=&gt;
      string(8) "woensdag"
      ["verwijder"]=&gt;
      int(2)
      ["vertoningId"]=&gt;
      string(1) "3"
    }
    [1]=&gt;
    array(11) {
      ["aantal"]=&gt;
      int(1)
      ["id"]=&gt;
      string(1) "1"
      ["filmtitel"]=&gt;
      string(11) "a_bugs_life"
      ["film_id"]=&gt;
      string(1) "2"
      ["zaal_id"]=&gt;
      string(1) "1"
      ["zaaltitel"]=&gt;
      string(6) "zaal 1"
      ["tijdstip"]=&gt;
      string(8) "15:00:00"
      ["stoeltjes"]=&gt;
      string(1) "7"
      ["dag"]=&gt;
      string(8) "woensdag"
      ["verwijder"]=&gt;
      int(2)
      ["vertoningId"]=&gt;
      string(1) "3"
    }
    [2]=&gt;
    array(11) {
      ["aantal"]=&gt;
      int(1)
      ["id"]=&gt;
      string(1) "1"
      ["filmtitel"]=&gt;
      string(11) "a_bugs_life"
      ["film_id"]=&gt;
      string(1) "2"
      ["zaal_id"]=&gt;
      string(1) "1"
      ["zaaltitel"]=&gt;
      string(6) "zaal 1"
      ["tijdstip"]=&gt;
      string(8) "15:00:00"
      ["stoeltjes"]=&gt;
      string(2) "22"
      ["dag"]=&gt;
      string(8) "woensdag"
      ["verwijder"]=&gt;
      int(2)
      ["vertoningId"]=&gt;
      string(1) "3"
    }
  }
}
</code></pre>

<p>now, from <code>$_SESSION['addedToCart]</code> i would like to remove arrays if they meet to certain conditions like. I have tried the following.</p>

<pre><code>foreach ($_SESSION["addedToCart"] as $arr) {
       if ($arr["stoeltjes"] == $stoeltje &amp;&amp; $arr['film_id'] == $id) {
            unset($arr);
       }
 }
</code></pre>

<p>this doesnt seem to work, it doesnt remove anything, i did a var_dump to check if the variables $stoeltje and $id were fine and they were fine so that cant be the problem.
am i able to use unset in this kind of situation?</p>
