Re: Removing link on the fly, but leave link text

From: Date: Tue, 31 Aug 2010 20:07:49 +0000
Subject: Re: Removing link on the fly, but leave link text
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-307785@lists.php.net to get a copy of this message
On Aug 31, 2010, at 2:34 PM, Joshua Kehn wrote:
On Aug 31, 2010, at 3:31 PM, Karl DeSaulniers wrote:
Hi, Say I have some text. $text = 'You can logon here: <a href="http://website.com/shop/index.php?username='.$username.'">http://website.com/shop/index.php?username='.$username.'</a>. This link will take you to your web browser to login.'.$eol; I want to be able to strip the "<a href="http://website.com/shop/index.php?username='.$username.'">" and </a>. Leaving just the http://website.com/shop/index.php?username='.$username.' text, so it would end up like. $text = 'You can logon here: http://website.com/shop/index.php?username='.$username.'. This link will take you to your web browser to login.'.$eol; I have tried MANY different ways and have no success. Can anyone help me? TIA Karl DeSaulniers Design Drumm http://designdrumm.com
Would it be safe to simply strip out anything between < and > ? Regards, -Josh ____________________________________ Joshua Kehn | Josh.Kehn@gmail.com http://joshuakehn.com
Hi Josh, Safe? Not sure what you mean. The text is for an email that is originally done in html code, that when sent, checks to see if the recipiant can get html emails. if not the text version is sent, but I want to remove any <a href""></a> tags before sending. This is how it starts: $text = 'You can logon here: <a href="http://website.com/shop/index.php?username='.$username.'">http://website.com/shop/index.php?username='.$username.'</a>. This link will take you to your web browser to login.'.$eol; This is how I want it if they dont get the thml version $text = 'You can logon here: http://website.com/shop/index.php?username='.$username.'. This link will take you to your web browser to login.'.$eol; Hope that clarifies Best, Karl DeSaulniers Design Drumm http://designdrumm.com

« previous php.general (#307785) next »