aviddv1 Posted June 30, 2006 Share Posted June 30, 2006 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 More sharing options...
Orio Posted June 30, 2006 Share Posted June 30, 2006 How do you want the link to look like?This way?<a href="page.php?id=1">click here</a>Orio. Link to comment https://forums.phpfreaks.com/topic/13313-replace-part-of-string/#findComment-51320 Share on other sites More sharing options...
Buyocat Posted June 30, 2006 Share Posted June 30, 2006 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. Link to comment https://forums.phpfreaks.com/topic/13313-replace-part-of-string/#findComment-51329 Share on other sites More sharing options...
eunicewt Posted June 30, 2006 Share Posted June 30, 2006 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? ThanksEunice Link to comment https://forums.phpfreaks.com/topic/13313-replace-part-of-string/#findComment-51335 Share on other sites More sharing options...
Orio Posted June 30, 2006 Share Posted June 30, 2006 Open a new thread for this.Orio. Link to comment https://forums.phpfreaks.com/topic/13313-replace-part-of-string/#findComment-51337 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.