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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.