pTutorial

New way to learn Programming

How To Reverse Htmlentities() Function

How to reverse htmlentities in php

We can PHP html_entity_decode() function to convert all the HTML entities in the string to their applicable character.

PHP html_entity_decode() function example

<?php
$string = "Hello &#8211; PHP";
$converted = html_entity_decode($string);
echo $converted;
?>

Output

Hello – PHP

Explanation

If you use PHP htmlentities() function to encode characters to HTML entities, you can use html_entity_decode() to reverse this process.

See Also


QUOTES OF THE DAY

Impossible is a word only be found in the dictionary of fools.

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER