adspace
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
What is the current stable version of php?
What is difference between static and final in php?
How to create a web form?
What does $_files means?
What is trait in php?
How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain
Explain me is it possible to destroy a cookie?
How to calculate the difference between two dates using php?
Which variable declarations within a class is invalid in php?
hello all, I need some sample placement papers in lion bridge.. can anyone help me?
how to detect a mobile device using php
What is the current stable version of php? What advance thing in php7?
What sized websites have you worked on in the past?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What is the difference between htmlentities() and htmlspecialchars()?