What is going here PHP - I don't understand?
<p>I have an assocaitive array with all different kind of values, but what is below will find all the array keys that end in <code>Study</code> and check the boolean value of it, but what I don't understand is how it works anyway care to explain a step by step explanation of it?</p>

<pre><code>$study = array_filter(array_intersect_key($user, array_flip(preg_grep('/Study$/', array_keys($user)))));

if ($study) {
     ......
}
</code></pre>

<p>How does php sort the keys that end in <code>Study</code>?</p>

<p>And are there any better ways to do this?</p>
