PHP : How to optimize the multiple conditional
<p>I have a loop with multiple conditionals</p>

<pre><code>foreach ($fields as $field_key =&gt; $value) {

if ($field_key !== 'a' &amp;&amp; $field_key !== 'b' &amp;&amp; $field_key !== '10200' &amp;&amp; $field_key !== 'z' &amp;&amp; $field_key !== 'y') {
 ...
//display $value;

}

}
</code></pre>

<p><em>How to optimize the code to avoid the multiple conditionals in the if clause?</em></p>

<p>I am thinking of filing an array with <code>{a, b, y, z}</code> an search against it for a value to not be found there, using <strong>e.g</strong> <code>in_array</code>, <code>search_array</code></p>
