title: how to find if a string contains two dot in regular expression in php
body: <p>I want to know if the string contains two <code>.</code>. for example if the string contains <code>www.example.com</code>, returns true ,because it has 2 <code>.</code>, otherwise has less than 1 <code>.</code> return false.</p>
  
  <pre><code>function containsTwoDot($array,$keyword){
     $matches = array_filter($array, function($var) use ($keyword) { return preg_match("/\b".$keyword."\b/i".$keyword, $var); });
     if($matches)
          return true;
     return FALSE;
  }
  
  $true[0]='www.sll.dl';
  $false[0]='ldfjls.dlfjdflldl';
  </code></pre>