Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

PHP htmlspecialchars_decode() Function

by
Category:php
php php string
PHP htmlspecialchars_decode() Function

The htmlspecialchars_decode() function converts some predefined HTML entities to characters. The htmlspecialchars_decode() function is the opposite of htmlspecialchars(). You may also like PHP html_entity_decode() Function and How to Encode and Decode URL Using PHP.

Example

<?php
$str = "This is some &lt;b&gt;bold&lt;/b&gt; text.";
echo htmlspecialchars_decode($str);
?>

The HTML output of the code above will be (View Source):

<!DOCTYPE html>
<html>
<body>
This is some <b>bold</b> text.
</body>
</html> 

Output

This is some bold text.

0 Comments


Html code work in comment box


Related Post