Valleriani Posted July 21, 2007 Share Posted July 21, 2007 Is there a specific way to search a string and remove a '.com/.etc' basicly if theres no space after the ., it would realize its a link.. like is the content was 'hello this is fun. you are now here.net here.' It would remove the here.net completely from the string. Simply I'm trying to remove links without http:// the best way. Guessing it would be by tracking the ending .'whatever' Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/61048-removing-links-without-http/ Share on other sites More sharing options...
Crew-Portal Posted July 21, 2007 Share Posted July 21, 2007 Thats Nice i like Cerial Myself Quote Link to comment https://forums.phpfreaks.com/topic/61048-removing-links-without-http/#findComment-303835 Share on other sites More sharing options...
MadTechie Posted July 21, 2007 Share Posted July 21, 2007 will that really help maybe www,google,com www[dot]google[dot]com www google com Quote Link to comment https://forums.phpfreaks.com/topic/61048-removing-links-without-http/#findComment-303842 Share on other sites More sharing options...
hvle Posted July 21, 2007 Share Posted July 21, 2007 use regex Quote Link to comment https://forums.phpfreaks.com/topic/61048-removing-links-without-http/#findComment-303854 Share on other sites More sharing options...
cooldude832 Posted July 21, 2007 Share Posted July 21, 2007 yes regex will work, but its over powering instead using string comparisions say something like <?php if(stristr($sring,"http://")){ //it has it in it at least, but we should compare if its the first five characters so } //this is better if(stristr($sring,"http://") && stripos($string."http://") == 0){ //now we know it contains it and is at beging ?> Quote Link to comment https://forums.phpfreaks.com/topic/61048-removing-links-without-http/#findComment-303864 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.