I have some text in a non-English/foreign language in my page, but when I try to make it lowercase, it characters are converted into black diamonds containing question marks.
$a = "Երկիր Ավելացնել"; echo $b = strtolower($a); //returns ����� ���������
I've set my charset in a metatag, but this didn't fix it.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
What can I do to convert my string to lowercase without corrupting it?
Description ¶ mb_strtolower(string $string , ? string $encoding = null ): string. Returns string with all alphabetic characters converted to lowercase.
The strtolower() function converts a string to lowercase. Note: This function is binary-safe. Related functions: strtoupper() - converts a string to uppercase.
The strtoupper() function converts a string to uppercase. Note: This function is binary-safe. Related functions: strtolower() - converts a string to lowercase.
The ucfirst() function converts the first character of a string to uppercase. Related functions: lcfirst() - converts the first character of a string to lowercase. ucwords() - converts the first character of each word in a string to uppercase. strtoupper() - converts a string to uppercase.
have your tried using mb_strtolower()?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With