-1

My database value is École Polytechnique Fédérale de Lausanne. I cannot convert to html characters. I tried to convert using following method,

echo html_entity_decode(École Polytechnique Fédérale de Lausanne');
echo html_entity_decode($Event['Event_speaker']);

Ist statement i got the actual result and the second one display exactly same as db value.

In my header am using

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">

Can someone help??

Lucky13
  • 11,393
  • 7
  • 25
  • 36
  • 2
    There are no HTML entities in your string. Why do you call html_entity_decode? – Peter Apr 02 '18 at 09:58
  • *"the second one display exactly same as db value"* – Alright, then you're correctly outputting what is in your database, that's good. The problem is that you have garbage in your database. – deceze Apr 02 '18 at 10:21

1 Answers1

0

Try this PHP predefined function

<?php
$str = "École Polytechnique Fédérale de Lausanne";
echo iconv_mime_decode($str);
TarangP
  • 2,711
  • 5
  • 20
  • 41
Siddhartha esunuri
  • 1,104
  • 1
  • 17
  • 29