title: JSON Search and remove in php?
body: <p>I have a session variable <code>$_SESSION["animals"]</code> containing a deep json object with values:</p>
  
  <pre><code>$_SESSION["animals"]='{
  "0":{"kind":"mammal","name":"Pussy the Cat","weight":"12kg","age":"5"},
  "1":{"kind":"mammal","name":"Roxy the Dog","weight":"25kg","age":"8"},
  "2":{"kind":"fish","name":"Piranha the Fish","weight":"1kg","age":"1"},
  "3":{"kind":"bird","name":"Einstein the Parrot","weight":"0.5kg","age":"4"}
  }'; 
  </code></pre>
  
  <p>For example, I want to find the line with "Piranha the Fish" and then remove it (and json_encode it again as it was).
  How to do this? I guess i need to search in <code>json_decode($_SESSION["animals"],true)</code> resulting array and find the parent key to remove but i'm stucked anyways.</p>