PHP array_search not working (returns empty string) : <p>I'm trying to check if a filename of an image contains "cover". Somehow this stopped working for me (Pretty sure it worked already). I copied the part of my function not working. </p>

<pre><code>$name=array("_IMG8555.jpg", "_IMG7769.jpg", "_IMG8458.jpg", "Cover.jpg", "_IMG7184.jpg");
$cov=array("Cover.png","Cover.jpg","Cover.jpeg", "cover.png","cover.jpg","cover.jpeg");
</code></pre>

<p>This does not work for me:</p>

<pre><code>print_r(array_search($cov, $name)); //Returns empty String
print_r($name[array_search($cov, $name)]); //Returns first element of the name Array
</code></pre>

<p>Also I added a test Strings to make sure this is not result the searched string is the same as the search value.</p>

<pre><code>print_r($name[3]===$cov[1]); //Returns true(1)
</code></pre>

<p>Can anyone help? Why does this simple script not work?</p>

<p>I also tried using <code>in_array()</code> but this is not working either.</p>
