PHP How to check if an array key equals a certain value?
<p>How do I check that an array key equals a value with an array like this:</p>

<p><code>Array ( [0] => stdClass Object ( [subCategory] => All Headphones [description] => [image] => ) [1] => stdClass Object ( [subCategory] => Behind-the-Neck Headphones [description] => [image] => ) [2] => stdClass Object ( [subCategory] => Clip-On Headphones [description] => [image] => ) [3] => stdClass Object ( [subCategory] => Earbud Headphones [description] => [image] => ) [4] => stdClass Object ( [subCategory] => Kids' Headphones [description] => [image] => ) )
</code></p>

<p>I've tried using this code:</p>

<pre><code>if(array_key_exists('subCategory',$array) {
          echo "Exists";
}
</code></pre>
