I need to filter out all, but alphanumeric, Latin-Chars AND emojis
$str="Hello José' [](){}✅., welcome";
wanted result:
Hello José ✅ welcome
echo preg_replace("/[^\p{Latin} \wp-]/u",'',$str); // this is what i need
but i also need to keep the emojis ✅
I have 2 , but one deletes also the emojis, the other keep emojis but deletes everything else. i need this 2 combined
preg_replace("/[^\p{Latin} \wp-]/u",'',$str);
preg_replace("/[ -\x{2122}]\s+|\s*[ -\x{2122}]/u",'',$str);