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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxx
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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux