What is the functionality of the function html entities?
Answer Posted / tushar kumar kundan
The htmlentities() function converts characters to HTML
entities.
==============================================================
Optional. Specifies how to encode single and double quotes.
The available quote styles are:
* ENT_COMPAT - Default. Encodes only double quotes
* ENT_QUOTES - Encodes double and single quotes
* ENT_NOQUOTES - Does not encode any quotes
=============================================================
<?php
$str = "Jane & 'Tarzan'";
echo htmlentities($str, ENT_COMPAT);
echo "<br />";
echo htmlentities($str, ENT_QUOTES);
echo "<br />";
echo htmlentities($str, ENT_NOQUOTES);
?>
==========================================================
the output
Jane & 'Tarzan'
Jane & 'Tarzan'
Jane & 'Tarzan'
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Tell me how to find current date and time?
What is php glob?
Is rent a variable cost?
What is use of header() function in php? What the limitation of header()?
Does php use html?
What does the scope of variables mean?
Explain me what is the goto statement useful for?
What are sql functions?
What is the basic function to search files for lines (or other units of text) that contain a pattern.
What are the differences between GET and POST methods?
What is the difference between static and dynamic websites?
What is difference between session and cookie in PHP?
What is the meaning of "enctype= multipart/form-data" ?
What are php parameters?
Give the case where we can use get and we can use post methods?