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
Do you know what is use of count() function in php?
What is the difference between overloading and overriding in php?
What is the difference between php and core php?
What is use of isset function in php?
Is php session id unique?
What is the php function that removes the first element of the array and returns it?
What is substr() in php? And how it is used?
Is php 7 backwards compatible?
How is traits used in php?
Which functions are used to remove whitespaces from the string?
What is the use of namespace in php?
How can you encrypt password using php?
How to insert a line break in php string?
Is php fully object oriented?
How does the identity operator ===compare two values in PHP?