title: Warning: substr_count(): Empty substring
body: <p>I'm suddenly getting an awful lot of errors saying "Empty substring" referring to line 8   </p>
  
  <pre><code>$score3 = substr_count($name_only, $text);
  </code></pre>
  
  <p>I have no idea what the issue is, this is a search function. Is it empty submission into the search box? </p>
  
  <p>I thought it might be so I made changes in with JS and HTML so isn't possible to submit the search form blank or with just whitespace, but still the error continues.</p>
  
  <p>This is my php, does anything stand out as the source of the issue to anyone with better knowledge than I have?</p>
  
  <pre><code>function search_now($images){
    global $text, $scores, $scores2, $scores3, $do_search;
    $images2 = array();
    foreach ($images as $key =&gt; $value) {
      $name_only = $value['name'];
      similar_text($text, $name_only, $score);                        
      $score2 = substr_compare($name_only, $text, 0);
      $score3 = substr_count($name_only, $text);
      if($do_search){
        if($score&lt;20)
        continue;
      }
      $images2[$key] = $value;
      $images2[$key]['score'] = $score;
      $images2[$key]['score2'] = $score2;
      $images2[$key]['score3'] = $score3;
      //$scores[$key] = ($do_search)? $score : $key;
      $scores[$key] = $score;
      $scores2[$key] = $score2;
      $scores3[$key] = $score3;
    }
    return $images2;
  }
  </code></pre>