johnwall Posted April 1, 2011 Share Posted April 1, 2011 Hi, I am pulling a couple of fields from a DB and I am assigned them all to one string, how can I include the € (euro synbol) in my string. I have something like $test = "Hello ".$name."you have €".$balance I am unable to create the € as normal using ctrl+alt+4, must I use somehting else? Rgds Chris Quote Link to comment Share on other sites More sharing options...
Nudd Posted April 1, 2011 Share Posted April 1, 2011 Use the html character code: € or € That should do it. Quote Link to comment Share on other sites More sharing options...
johnwall Posted April 4, 2011 Author Share Posted April 4, 2011 Hi, Sorry should have mentioned that this string I create is passed using PHPExcel to a spreadsheet, in the cell the HTML code of the euro symbol appears instead of the symbol itself. Rgds Chris Quote Link to comment Share on other sites More sharing options...
BluB Posted April 5, 2011 Share Posted April 5, 2011 Hey, Either this: $data=str_replace(chr(0xC2).chr(0x80) , chr(0xE2).chr(0x82).chr(0xAC), utf8_encode("Hello ".$name."you have €".$balance") ); Or this: $data=str_replace(chr(0xC2).chr(0x80) , chr(0xE2).chr(0x82).chr(0xAC), "Hello " . $name . "you have €" . $balance); Should work, depending on whether your data is already UTF-8 encoded or not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.