user198003
user198003

Reputation: 11151

How to convert HTML chars in PHPExcel?

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?

Upvotes: 6

Views: 6523

Answers (1)

Mark Baker
Mark Baker

Reputation: 212412

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

Upvotes: 12

Related Questions