html_entity_decode not working for some html entities like „

576 Views Asked by At

I have the following code:

echo html_entity_decode("„", ENT_QUOTES, "UTF-8");

Result is „ but expected result is .

I also tried ISO-8859-1 instead of UTF-8, but it's still the same.

Why isn't html_entity_decode working in this case?

1

There are 1 best solutions below

1
Otávio Barreto On

This is a special char, not html entity, so I thin this would be the right way.

<?php
    $str = "&#132;";
    echo htmlspecialchars_decode($str);

    ?>