How can I make sure that it is only one http:// in a string?
$url = "http://mysite.com/http://http://mysite.com/";
# set the regex for checking.
$regex = '/^\bhttp:\b\/\/.*/';
# reject the url address if it doesn't match
if (!preg_match($regex, $url)) echo 'false';