简体   繁体   中英

™ 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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