Search in site contents by php
<p>I use codeigniter.I want search in site contents for several word, that did existence it word in it site or no? if existence a word (of all words) in it site return is FALSE. i tried as following code but get error. How can done it?</p>

<p><strong>DEMO:</strong> <a href="http://codepad.viper-7.com/rFiL01" rel="nofollow">http://codepad.viper-7.com/rFiL01</a></p>

<pre><code>&lt;?php
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,'stackoverflow.com');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $contents = curl_exec($ch);
        curl_close($ch);
        $link[] = array("Questions", "Favorite", "myfoodho");
                foreach($link as $val){
                    stristr($contents,$val); // Line 148
                    //if(){
                    //      return true;
                    //}else{
                    //    return false;
                    //}
                }
?&gt;
</code></pre>

<p>Error:</p>

<blockquote>
  <p>A PHP Error was encountered</p>
  
  <p>Severity: Warning</p>
  
  <p>Message: stristr() [function.stristr]: needle is not a string or an
  integer</p>
  
  <p>Filename: views/exchange.php</p>
  
  <p>Line Number: 148</p>
</blockquote>
