&deal; from a database that does not display a character

In my database, some products have a “next to” symbol. This is written to the database using ™. However, when I repeat this from the database, it literally outputs ™instead of the actual character.

Any ideas on how I can avoid this and make it actually display a character?

+3
source share
2 answers

Maybe this might work if you try to replace & trade with the code specified by @wild.

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

use this code where you want to print TM

echo '&#0153';
+2
source

All Articles