What is the functionality of the function html entities?
Answers were Sorted based on User's Feedback
Answer / sunil biyani
Convert all applicable characters to HTML entities (PHP 3,
PHP 4 , PHP 5)
string htmlentities ( string string [, int quote_style [,
string charset]] )
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / vijaya
htmlentities will convert all applicable characters to HTML
entities.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / 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 |
Would you initialize your strings with single quotes or double quotes?
What is the use of $_server["php_self"] variable?
What is meant by urlencode and urldecode?
Where is session id stored?
what is Opern source?
What is an example of a variable?
What the difference between the 'bitwise and' operator and the 'logical and' operator?
what is difference between edit and update?
Is php used for frontend or backend?
Why we use get in php?
how to hidden querystring url please send sample program
Which cryptographic functions in php returns the longest hash value?