$url
=
"http://google.com/"
;
if
(preg_match(
'/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i'
,
)) {
echo
"Your url is ok."
}
else
{
"Wrong url."