title: Search for a value in JSON using php
body: <p>I have a JSON file in this format:</p>
  
  <pre><code>[
   ["name","purpose","description"],
   ["name2","purpose2","description2"],
   ["name3","purpose3","description3"]
  ]
  </code></pre>
  
  <p>Now, I have got the solutions for finding them by key. But, my JSON doesn't have keys. How can I search inside this JSON object to find second element by using "purpose2"? Also, I need to display the second element (i.e. "name2","purpose2","description2").</p>
  
  <p>I used this function, but it's not helping me out.</p>
  
  <pre><code>function searchJson($obj, $value) {
  foreach($obj as $item) {
      foreach($item as $child) {
          if(isset($child) &amp;&amp; $child == $value) {
              return $child;
          }
      }
  }
  return null;
  }
  </code></pre>
  
  <p>Thanks in advance !</p>