I'm making a bookmarks feature for my website, and I got the cookie system and all already working, but when users forget to put a http:// before the link, it will point to my server and make the link useless.
Now I want to make a system that checks the links before they get submitted, and add a http:// if it's missing.
Now i'm thinking that I can use preg replace to do this, but I really don't understand how to use it.
If someone can make a simple sample for me and show me a good tutorial to use preg replace I can get on with my project
.
The php.net page about the function is really lacking good explanation.
TIA