Verifying all Keys in an Array
<p>Currently, this is what I do to check if all keys of an array <strong>$A</strong> are <strong>within a subset</strong> of another array <strong>$B</strong>.</p>

<pre><code>$B = array('a', 'b', 'c', 'd');

if(array_keys($A) == array_intersect(array_keys($A), $B))
{
 action if true
}
</code></pre>

<p>I am wondering if there is a more straight forward way of doing this, something like the <code>in_array()</code> function.</p>

<p><strong>Usage Example</strong>:</p>

<p>Checking the $_POST array to ensure that all keys matches a dynamic form and filter out extra keys if the form is hacked.</p>
