What is the functionality of the function html entities?

Answers were Sorted based on User's Feedback



What is the functionality of the function html entities?..

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

What is the functionality of the function html entities?..

Answer / vijaya

htmlentities will convert all applicable characters to HTML
entities.

Is This Answer Correct ?    6 Yes 0 No

What is the functionality of the function html entities?..

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

Post New Answer

More PHP Interview Questions

Differentiate echo vs. Print statement.

0 Answers  


What is the main difference between asp net and php?

0 Answers  


1.What are the difference between echo , print , print_r ? else this 3 can we show output to a client in some other way?

16 Answers   Leeway Hertz,


What is php used for?

0 Answers  


What is the use of Php variables?

0 Answers  


What are the different types of PHP arrays?

0 Answers  


What is printf in php?

0 Answers  


What are the file upload settings in configuration file?

0 Answers  


How to convert a timezone from one to another ?

1 Answers  


How to convert a character to an ascii value?

0 Answers  


how can i develop forum code? any one pleale help me on this question

0 Answers  


How to run a php script?

0 Answers  


Categories