Hello, everybody, this is my first post to this great forum.
I have tried to solve this problem by myself but failed.
User can input a string in my html form. I want to "clean" it so it contains only a-z, A-Z, 0-9, space, and only these latin letters U+010C, U+010D, U+0106, U+0107, U+0110, U+0111, U+0160, U+0161, U+017D, U+017E (ČčĆćĐđ????).
1. I thought I know to deal with the first part of my problem
$cleanstring = preg_replace('/[^a-zA-Z0-9 ]/', '', $originalstring);
but unfortunately if, for example, $originalstring = 'Đakče', $cleanstring will be '272ak269e'. I do not understand why preg_replace will not duplicate 'Đ' and 'č' chars in return string.
2. Even if I knew how to solve this previous problem, I would still not know how to include ČčĆćĐđ???? in my preg_replace search pattern. Is there a way to include them one by one as a hex values, or some other solution?
Edit: For test purposes I tried using str_replace('Đ', 'Ok', $originalstring), but it does not work, return string is the same as original. Why?
Can anybody help?
Thank you in advance!
milosh