Check if a value exits in array (Laravel or Php) : <p>I have this array:</p>

<pre><code>$list_desings_ids = array('hc1wXBL7zCsdfMu','dhdsfHddfD','otheridshere');
</code></pre>

<p>With a die() + var_dumo() this array return me:</p>

<pre><code>array:2 [▼
  0 =&gt; "hc1wXBL7zCsdfMu"
  1 =&gt; "dhdsfHddfD"
  2 =&gt; "otheridshere"
]
</code></pre>

<p>I want check if a design_id exits in $list_desings_ids array.</p>

<p>For example:</p>

<pre><code>foreach($general_list_designs as $key_design=&gt;$design) {
    #$desing-&gt;desing_id return me for example: hc1wXBL7zCsdfMu
    if(array_key_exists($design-&gt;design_id, $list_desings_ids))
    $final_designs[] = $design;
}
</code></pre>

<p>But this not works to me, what is the correct way?</p>
