For this kind of tasks regular expressions are the key. With this function i am able to get URLs in the most common formats:
- With www: www.google.com
- Without www: http://google.com
- With www and http: http://www.google.com
- And even with https.
Take a look at it:
Join 2,000+ readers and learn something new every month!