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 csrf token and how it works?
Could we start a variable with number like $4name?
What are the differences between php3 and php4 and php5? What is the current stable version of php? What advance thing in php7?
How to get no of arguments passed to a PHP Function?
What is the meaning of xdebug?
What is htaccess? Why do we use this and where?
What are the rules for naming a php variable?
Tell me what is the difference between exception::getmessage and exception::getline?
How do you put a space in html?
What are the different components used in php for formatting?
How we can declare variable in php?
Is php a middleware?
What are the different filter functions used to filter a variable?
List some array functions in php?
How can we connect to a mysql database from a php script?