Which will display as ™ This applies for html and php equally It also gets around issues with text encoding, which is what seems to be the issue for you, though without a bit more information it's hard to say exactly what. I'm using domdocument to load an xml document from a string generated in php One particular node needs to have a trademark symbol in it's value and i'm having trouble getting that to load with domdocument. The symbol is stored in a table which can display properly when viewed from phpmyadmin, but when i use php to retrieve the table content, it does not display the symbol but instead displaying a symbol of a diamond with a
Using the global function htmlentities in php, you can convert a string with 'special characters' to one using html entities $variable = enzyme™ is a trademark; Regex is not enough for what you want First you must write code to identify when content is a value of an attribute or a text node of an element Then you must through all that content and use some replace method I am not sure what it is in php, but in javascript it would look something like:
A change is made to the textarea data and it is submitted via jquery When it arrives in php it appears to be translated to \u2122 and gets updated in mysql that way.
WATCH