I have searched around this topic and don’t get a exact solution I need, so posting a new thread.
I need a url validation method in php, but it should allow following types
google.com
ww.google.com/
sub.google.co.in
http://google.com
https://www.google.com
ftp://google.com/sub/index.php?id=124&id2=222#field,2013
and all possible urls