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
List some string function name in php?
What is cakephp framework?
Explain about getters and setters in php?
Tell me which programming language does php resemble to?
Are php session secure?
How many open modes available when a file open in PHP?
How to retrieve the original query string?
How can we display information of a variable and readable by a human with php?
What is file upload?
What is the difference between php and javascript?
Does strlen include null?
Where can I find php ini file?
Explain php split() function.
Explain the three different kinds of Arrays?
What is crypt () in php?