Why will this function not work?
<p>I have the following function that I know should return TRUE but it will not.  </p>

<pre><code>function myFunc($str,$array)
{
  foreach($array as $k=&gt;$v) 
  {
    if(strtolower($v) == strtolower($str)) 
    { 
      return TRUE; 
    }
  }
  return false;
}
</code></pre>

<p>This function is used inside a class in an if statement <code>if($this-&gt;myFunc($something, $array)){</code></p>

<p>No matter what I do, it will not return true even though I echo some text above the return TRUE; and that is displayed. Any help for something I am missing, that would be great.</p>

<p>Sorry for not posting the codes.<br>
My array prints the following  </p>

<pre><code>Array
(
[0] =&gt; -1
[1] =&gt; Platinum
[2] =&gt; 169
)
</code></pre>

<p>and </p>

<pre><code>$something = '-1';
</code></pre>

<p>I am trying to return true if -1 exists. The problem I don't think is if the value is in the array. The issue I have is to why it will not return as true, it will echo a value but it will not return anything. I tried using in_array and the function still did not return as true, which is why I tried this method. Could this be an issue with my PHP version?
I used strtolower because this function will be reused throughout the page to search for other values.</p>

<p>Thanks</p>
