title: substr_count() count whole words in php
body: <p>i'm a newbie in php, so, i was making a word counter program. I was trying to count how many instances of specific words are in a website.
  So, i was using Substr_count to count the words, but the issue is that it picks up words like "sunlight" as containing words like "sun".</p>
  
  <p>This is my code.</p>
  
  <pre><code> /*When the user types the word*/
   $search = $_POST["texto"]; 
  
   /*The website*/
   $page = $_POST["Web"];
  
   $web = file_get_contents($page);
  
   /*Count words*/
   $result = (substr_count(strip_tags(strtolower($web)), strtolower($search)));
  
  /*Display the information*/
  if($result == 0){
  echo "the word " .mb_strtoupper($search). " doesn't appear";    
  }else{
  echo "the word " .mb_strtoupper($search). " appears $result times";
  }
  </code></pre>
  
  <p>Any way to fix this? I tried str_word_count and preg_match_all but this displays big numbers.</p>