PHP: chr Function Problem with Special Characters
chr and ord only work with single-byte ASCII characters. More specifically, ord looks only at the first byte of its parameter.
The Euro sign is a three-byte character in UTF-8: 0xE2 0x82 0xAC , therefore ord("€") (with the UTF-8 character) returns 226 (0xE2)
For characters that are also present in the ISO-8859-1 (latin1) character set, you can use utf8_encode() and utf8_decode() , but unfortunately the € sign is not contained there, so utf8_decode('€') will return "? " and cannot be converted back.
TL DR: You cannot use ord and chr with multibyte encoding like UTF-8