Text Formatting Functions
Posted: Tue Dec 14, 2010 12:12 pm
I don't know if this is the correct forum for this topic but here goes.
I have an application where I want to use a form textarea to enter text, provide the ability to preview the text, similar to blogs, then email the completed message to multiple recipiants.
The problems come in when trying to handle HTML link code (<a href=""></a>) and hard returns. I have experimented a bit with the PHP function htmlspecialchars and have used the PHP mail function where returns must be specified as \n or \r\n.
My question is, does PHP have a function to replace hard returns with \n and is there a way to preserve HTML link code in the final email message or do I have to process the text myself? I would prefer not to implement blog-like capabilities.
Thanks for any help,
Bob
I have an application where I want to use a form textarea to enter text, provide the ability to preview the text, similar to blogs, then email the completed message to multiple recipiants.
The problems come in when trying to handle HTML link code (<a href=""></a>) and hard returns. I have experimented a bit with the PHP function htmlspecialchars and have used the PHP mail function where returns must be specified as \n or \r\n.
My question is, does PHP have a function to replace hard returns with \n and is there a way to preserve HTML link code in the final email message or do I have to process the text myself? I would prefer not to implement blog-like capabilities.
Thanks for any help,
Bob