简体   繁体   English

来自数据库的™不显示符号

[英]™ from database not showing symbol

In my database, some products have a ™ symbol next to them. 在我的数据库中,有些产品旁边有一个™符号。 This is recorded in the database by ™ 这通过™记录在数据库中™ . However when I echo this out from the database, it literally prints out ™ 然而,当我从数据库中回应这一点时,它确实打印出来™ instead of the actual ™ symbol. 而不是实际的™符号。

Any ideas on how I can avoid this and get it to actually display the symbol? 关于如何避免这种情况并让它实际显示符号的任何想法?

在要打印TM的地方使用此代码

echo '&#0153';

May be this can work for you try replacing &trade with the code mentioned by @wild. 也许这可以为你尝试用@wild提到的代码替换和交易。

$string = "™ here is a string";
$search = "™";
$replace =  '&#0153';
echo str_replace($search, $replace, $string);

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

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