Jump to content

Archived

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

aviddv1

replace part of string

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

Share this post


Link to post
Share on other sites
How do you want the link to look like?
This way?
<a href="page.php?id=1">click here</a>

Orio.

Share this post


Link to post
Share on other sites
Use eregi_replace or preg_replace, you can read about both on php.net if you search for them.  In a nutshell you put a pattern, replacement and string and it does the rest.

Share this post


Link to post
Share on other sites
Hi,
    I want to know how to trigger an email to inform the manager this user has updated his profile and it was also uploaded in the database at the same time? Thanks
Eunice

Share this post


Link to post
Share on other sites

×

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.