title: PHP if IP or Domain detect function
body: <p>Is there a way to detect if a string is a Ip or Domain using php, example below.</p>
  
  <pre><code>$string = "http://192.168.0.0";
  $string = "http://example.com";
  </code></pre>
  
  <p>So if the string is a IP the script/function will do something if it detects it as Domain it will do something else.</p>
  
  <p>Thank you</p>