I take a web address as an input from the user using a form element in HTML:
<form action="parse.php" method="post">
Web address :
<input type="text" name="addr">
<input type=submit value="Go">
</form>
The problem is that the user can enter a url in the any of the following formats:
google.com
www.google.com
http://www.google.com
No matter what the user enters, I want the url to be of form http://www.google.com.
What's the best way to implement this in php, other than checking for all possibilities?