Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

htmlentities (PHP 4, PHP 5, PHP 7, PHP 8) htmlentities — Convert all applicable characters to HTML entities

<?php
$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str);

// Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str, ENT_QUOTES);
?>
 
PREVIOUS NEXT
Tagged: #htmlentities #PHP #PHP #PHP #htmlentities #Convert #applicable #characters #HTML #entities
ADD COMMENT
Topic
Name
2+8 =