onlyican Posted January 31, 2007 Share Posted January 31, 2007 Hey peopleI forgot how to do this.Here is the situationWe built a script for someone to send out newsletters, and they keep forgetting to add http:// on the linksI forgot, how do I check that when there is a www.something.somethingI can make ithttp://www.something.somethingBut if there is a http://, then leave itThe links are in the middle of text blocks Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted January 31, 2007 Share Posted January 31, 2007 preg_replace('/(?!http(s)?\/\/)www/', 'http://www' , $string);Or something like that anyway. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.