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 Link to comment https://forums.phpfreaks.com/topic/36491-check-links-to-make-valid/ 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. Link to comment https://forums.phpfreaks.com/topic/36491-check-links-to-make-valid/#findComment-173725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.