PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
hob_goblin
Forum Regular
Posts: 978 Joined: Sun Apr 28, 2002 9:53 pm
Contact:
Post
by hob_goblin » Fri May 17, 2002 8:16 pm
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");
fatal
Forum Contributor
Posts: 118 Joined: Sat Apr 20, 2002 10:47 am
Location: East Coast
Post
by fatal » Fri May 17, 2002 11:30 pm
you could use srt_replace also to achieve that, but RE could be easier
hob_goblin
Forum Regular
Posts: 978 Joined: Sun Apr 28, 2002 9:53 pm
Contact:
Post
by hob_goblin » Fri May 17, 2002 11:35 pm
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
fatal
Forum Contributor
Posts: 118 Joined: Sat Apr 20, 2002 10:47 am
Location: East Coast
Post
by fatal » Fri May 17, 2002 11:51 pm
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.
hob_goblin
Forum Regular
Posts: 978 Joined: Sun Apr 28, 2002 9:53 pm
Contact:
Post
by hob_goblin » Sat May 18, 2002 1:06 am
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