I have problems with removing special characters. I want to remove all special characters except "( ) / . % - &", because I'm setting that string as a title.
I edited code from the original (look below):
preg_replace('/[^a-zA-Z0-9_ -%][().][\/]/s', '', $String);
But this is not working to remove special characters like: "’s, "“", "â€", among others.
original code: (this works but it removes these characters: "( ) / . % - &")
preg_replace('/[^a-zA-Z0-9_ -]/s', '', $String);
’is the result when the character’(U+ 2019) is encoded in UTF-8 (0xE28099) and interpreted with a single-byte character encoding like Windows-1252.preg_replace('/[^a-zA-Z0-9_ -]/s', '', $String);. Thank you!