title: PHP Multi-Dimensional array search (with array_search)
body: <p>I am aware of <a href="https://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search">this question</a>, but I have an additional one to search for an array-key. Take a look at this:</p>
  
  <pre><code>array(2) {
    [0]=&gt;
    array(2) {
      ["name"]=&gt;
      string(6) "Text 1"
      ["types"]=&gt;
      array(3) {
        [0]=&gt;
        string(7) "Level 1"
        [1]=&gt;
        string(14) "something else"
        [2]=&gt;
        string(15) "whatisearchfor1"
      }
    }
    [1]=&gt;
    array(2) {
      ["name"]=&gt;
      string(6) "Text 2"
      ["types"]=&gt;
      array(3) {
        [0]=&gt;
        string(7) "Level 2"
        [1]=&gt;
        string(14) "something else"
        [2]=&gt;
        string(15) "whatisearchfor2"
      }
    }
  }
  </code></pre>
  
  <p><a href="https://secure.php.net/manual/de/function.array-search.php#116635" rel="nofollow">This snippet</a>...</p>
  
  <pre><code>echo array_search("Text 2", array_column($response, "name"));
  </code></pre>
  
  <p>...gives me a 1 for the second array-key, in which the term was found. </p>
  
  <p><strong>But how do I receive the <em>global</em> array-key (0 or 1), if I search for <em>whatisearchfor2</em>, which is stored in the multi-array "types"?</strong></p>
  
  <pre><code>echo array_search("whatisearchfor2", array_column($response, "types"));
  </code></pre>
  
  <p>...doesn't work.</p>