Martin AJ Martin AJ -4 years ago 156
PHP Question

Why trim() affects on the other characters?

The result of this code:

echo trim('سلام؟', '؟');


Why? I don't even know what's
supposed to be. Where does that come from?

Answer Source

I think this is because it is right-toleft- language, You can use rtrim()

phpFiddle - Hit "Run F9" to execute

echo rtrim('سلام؟', '؟');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download