简体   繁体   English

在JavaScript和PHP中使用欧元符号

[英]Using the Euro symbol in JavaScript and PHP

I using the price in Euro in JavaScript: 我在JavaScript中使用欧元价格:

var currency = '\u20AC';
Total Sum = Sum in Euro

When I try to use in PHP mail, the Euro symbol appears differently. 当我尝试在PHP邮件中使用时,欧元符号的显示方式有所不同。 I used the following command: 我使用以下命令:

$mail_body_reply=Sum from Javascript
mail($email, $subject_reply, $mail_body_reply, $header_reply);

What is the way to make it act the same in PHP and JavaScript? 使它在PHP和JavaScript中发挥相同作用的方法是什么?

You have to add encoding to the mail header, like described in a comment to documentation for function mail() . 您必须将编码添加到邮件头中,如功能mail()的文档注释中所述。

The right encoding is probably ISO/IEC 8859-15 . 正确的编码可能是ISO / IEC 8859-15

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM