Page 1 of 1

text to links

Posted: Fri May 17, 2002 8:16 pm
by hob_goblin
In mostly all the scripts i see if you type out http:// something .com
it will replace it with a link

I know this is so incredibly easy to do, but I was working with it earlier, and I was just drawing a blank..
i know it's

$foo = ereg_replace("something", "something", "$foo");

Posted: Fri May 17, 2002 11:30 pm
by fatal
you could use srt_replace also to achieve that, but RE could be easier

Posted: Fri May 17, 2002 11:35 pm
by hob_goblin
im not worried about being able to replace strings...
just confused what to search for, and especially how to replace it without losing the link

Posted: Fri May 17, 2002 11:51 pm
by fatal
search for 'http://' and '.com, .net, ect.' But searching for the '.com' and the rest can be a bitch. Unless you feel like typing out a list of them.

Posted: Sat May 18, 2002 1:06 am
by hob_goblin
hmm, well i can probably figure that out unless someone posts it, but i just wasn't sure if there was a way to put it all in one line