You may need to tell the browser which encoding you are using - I assume UTF-8.
To achieve this, you can try putting this piece of code at the beginning of your script before any output is generated:
header('Content-type: text/html; charset=UTF-8');
[ utf8_decode ][1] will try to decode your string from UTF-8 to latin1, which is not suitable for Arabic characters - hence the characters '?' .
Pascal martin
source share