货币符号在PHP中未正确显示
货币符号显示不正确。 下面是我的代码:货币符号在PHP中未正确显示,php,currency,Php,Currency,货币符号显示不正确。 下面是我的代码: $total = "₮50.40"; echo $total."<br>"; //output: ₮50.40 $str3 = substr($total, 0, 1); echo $str3; //output: � $total=“₮50.40”; echo$total.“”//输出:₮50.40 $str3=substr($total,0,1); echo$str3//输出:� 变量$total显示正确。但是我从$total中提取
$total = "₮50.40";
echo $total."<br>"; //output: ₮50.40
$str3 = substr($total, 0, 1);
echo $str3; //output: �
$total=“₮50.40”;
echo$total.“
”//输出:₮50.40
$str3=substr($total,0,1);
echo$str3//输出:�
变量$total
显示正确。但是我从$total
中提取了符号并显示出来,不幸的是它显示了� .
我想显示₮from变量$total
。
我尝试了
utf8
编码,但没有成功。字符是多字节字符,因此需要使用,而不是substr
:
$total = "₮50.40";
$str3 = mb_substr($total, 0, 1);
echo $str3;
输出:
₮