This question already has an answer here:
My code:
echo mb_convert_case('Björk Guðmundsdóttir', MB_CASE_UPPER, 'UTF-8');
echo mb_convert_case('Björk Guðmundsdóttir', MB_CASE_LOWER, 'UTF-8');
and the output:
BJRK GUMUNDSDTTIR
bjrk gumundsdttir
Some characters were deleted. Anyone know why?
UPDATE 1:
I noticed that my PHP file was note saved as UTF-8. So, I saved it as UTF-8 and ran the code again. My new results:
BJÖRK GUÃMUNDSDÓTTIR
björk guðmundsdóttir
UPDATE 2:
I guess the problem was just that it was being displayed weird in the browser. Solved by adding header('Content-Type: text/html; charset=utf-8');
</div>
Firstly make sure your editor is set to UTF-8 without BOM, then you must make sure that the text you passed to the function is actually UTF-8, since that is what you specified as the third argument. Then it should work
EDIT: You might also want to check that your browser is interpreting the characters correctly and make sure the page is setting the content-type, using either a <meta>
tag or PHPs header()