Jump to content

replace part of string


aviddv1

Recommended Posts

Maybe I'm a moron or something.  I can't figure out the most efficent way to do this.

I've got a string: "the test string contants a link. [link]page.php||id=1||click here[link] to see the link."

I want replace [link]...[link] with something like: <a href="<?php echo make_link('page.php','id=1'); ?>">click here</a>

Basically I'm trying to embed a link in a field in a mysql table and then pass the link info to a function called make_link that will add some other parameters and return the full url.

How on earth can I do this?  Any good ideas?

Thanks,
ward

Link to comment
https://forums.phpfreaks.com/topic/13313-replace-part-of-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.