What's the best way to remove symbols, like the Registered, Trademark, and Copyright symbols from a string?
For instance I'd like to strip the ® out of the following: $string = 'Can't Touch This®';
To remove it, go to Fle Tab | Options | Proofing | Click "Auto Correct Options..." button | click the (c) then Delete, same as the (r). Was this reply helpful?
Proper Placement of the Registered Trademark Symbol It's recommended that the registered trademark symbol be used in connection with all registered trademarks. It should either be placed to the lower right (subscript) or to the upper right (superscript) of the actual mark.
If you know what you want to remove, then use str_replace()
For instance:
$my_string = str_replace(array('®', '™'), array('', ''), $my_string)
If you've got a long list of 'forbidden' characters, you could use array_fill(0, count($forbidden_list), '')
$str = preg_replace("/(™|®|©|™|®|©|™|®|©)/", "", $str);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With