Developing PHP application that generates Excel documents on the fly, using PHPExcel (http://phpexcel.codeplex.com/).
Problem I have is that my Excel document will contain some special HTML chars, like °
, ’
, ”
etc...
But in generated XLS file, all I getting is °
, ’
, ”
, etc, not °, ’, ”, like I need.
Can you help me how to get this in XLS documents?
Definition and Usage. The html_entity_decode() function converts HTML entities to characters. The html_entity_decode() function is the opposite of htmlentities().
htmlentities() Function: The htmlentities() function is an inbuilt function in PHP that is used to transform all characters which are applicable to HTML entities. This function converts all characters that are applicable to HTML entities. Syntax: string htmlentities( $string, $flags, $encoding, $double_encode )
Remember that you should always use UTF-8 for strings in PHPExcel
$str = '32°Fahrenheit = 0°Centigrade';
$str = html_entity_decode($str,ENT_QUOTES,'UTF-8');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With