title: PHP array key exists from string
body: <p>I have an array:</p>
  
  <pre><code>&lt;?php
      $array = [
          'fruits' =&gt; [
              'apple' =&gt; 'value',
              'orange' =&gt; 'value'
          ],
          'vegetables' =&gt; [
              'onion' =&gt; 'value',
              'carrot' =&gt; 'value'
      ];
  </code></pre>
  
  <p>I also have a string:</p>
  
  <pre><code>$string = 'fruits[orange]';
  </code></pre>
  
  <p>Is there any way to check if the - array key specified in the string - exists in the array?</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;?php
  if(array_key_exists($string, $array)) 
  {
      echo 'Orange exists';
  }
  </code></pre>