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 what is mean by an associative array?
What is the difference between php and javascript?
What is singleton pattern in php?
How does the identity operator ===compare two values in PHP?
What are the advantages of using php?
How many functions are there in php?
How is it possible to parse a configuration file?
What is Type hinting in PHP?
How to write a program to make chess?
Tell me which programming language does php resemble to?
Explain the difference between static and dynamic websites?
How is php different from other languages?
Which software is used to run php programs?
Is php deprecated?
Is multiple inheritance supported in php?