質問

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?

役に立ちましたか?

解決

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);

他のヒント

use this code where you want to print TM

echo '&#0153';
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top