reliablec Posted September 15, 2008 Share Posted September 15, 2008 Hi everyone, I have a page where the ™ and ® are not displaying correctly. What I want to do is swap these values for the HTML codes ® and ™ respectively. When I try: preg_replace("/\™/", "™", $var_name); preg_replace("/\®/", "™", $var_name); These do not work. Does anyone have experience with swapping these symbols using preg_replace? Or are there other tools out there that I could use to perform this function? Your help is appreciated. Thanks Kent Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 16, 2008 Share Posted September 16, 2008 Just use str_replace() for this kind of thing. $var_name = str_replace("™", "", $var_name); $var_name = str_replace("®", "®", $var_name); Quote Link to comment Share on other sites More sharing options...
effigy Posted September 16, 2008 Share Posted September 16, 2008 ™ and ® are not displaying correctly How do they display? What encoding are you in? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.