I was wondering how I can turn a comment (such as stackoverflow.com) to a post as a URL so that when clicked, it will go straight to the website?
Thanks for your help in advance
I was wondering how I can turn a comment (such as stackoverflow.com) to a post as a URL so that when clicked, it will go straight to the website?
Thanks for your help in advance
 
    
    You can pre-process your text and look for things that might be a URL. Look at this answer here: Regex to match URL.
You'd want to take your text, split it by white-space, then for each white-space-separated word, check if it's a URL. If it's a URL, then output a proper <a> tag surrounding it. If not, just output the word.
 
    
    