title: Performing strstr on an array
body: <p>I managed to do this before somehow and have forgotten how to do it.  I keep getting an undefined offset notification for element associations (e.g. where $arr[$i] => "something").  E.g. for the following:</p>
  
  <pre><code>for($i=0;$i&lt;count($arr);$i++) {
  
    if($a = strstr($arr[$i], "str"))
    {
      print "Found: ". $a. "&lt;br&gt;";
    }
    else {
  
      if($i &gt;= count($arr))
      {
        print "Couldn't find &lt;i&gt;str&lt;/i&gt;.&lt;br&gt;";
        return false;
      }
    }
  }
  </code></pre>
  
  <p>That won't work and will output an undefined offset notification.  Any help is greatly appreciated!</p>