string - replace trademark symbol (™) with html code in php -


i have following string:

$str='enzyme™ trademark';

now want put string in csv file like: 'enzyme™ trademark', `because if "™" placed in csv file, magento import product setup escapes it.
can please me on issue googled lot not found correct suggestion. sorry 4 bad english.

i tried following code:

htmlentities($db->col['title'], ent_quotes | ent_ignore, "utf-8");//but removes '™'<br>  htmlentities($db->col['title'], ent_quotes , "utf-8"); //removes whole string <br> 

using global function htmlentities in php, can convert string 'special characters' 1 using html entities.

$variable = "enzyme™ trademark"; $convertedvariable = htmlentities($variable); echo $convertedvariable; // echos: enzyme&trade; trademark 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -