<?php
// Everything you enter here will be executed by our servers. Try it!
$domain = "stackoverflow.com";
$uriToTest = "http://stackoverflow.com/";
$pattern = "/^http(s)?://(([a-z]+)\.)*/";
$result= preg_match($pattern, $uriToTest);
print_r($result);