Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
货币符号在PHP中未正确显示_Php_Currency - Fatal编程技术网

货币符号在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;
输出: