title: How to validate a domain name using Regex & PHP?
body: <p>I want a solution to validate only domain names not full URLs, The following example is what I'm looking for:</p>
  <pre class="lang-none prettyprint-override"><code>example.com -&gt; true
  example.net -&gt; true
  example.org -&gt; true
  example.biz -&gt; true
  example.co.uk -&gt; true
  sub.example.com -&gt; true
  example.com/folder -&gt; false
  exam*$ple.com -&gt; false
  </code></pre>