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

WWhat is the functionality of md5 function in PHP?

7 Answers   Tech Mahindra,


How to include variables in double-quoted strings in php?

0 Answers  


Who is the father of PHP and explain the changes in PHP versions?

15 Answers   ADISoft Tech, Genpact, PropTiger, TWA,


Explain the types of functions for Splitting String?

0 Answers  


Explain what is the difference between for and foreach?

0 Answers  






Is php strongly typed?

0 Answers  


Where is php code written?

0 Answers  


How to get the DNS servers of a domain name?

1 Answers   Life Infotech,


How we can retrieve the data in the result set of mysql using php?

0 Answers  


What is MVC structure in Magento?

4 Answers  


How can we convert the time zones using PHP?

1 Answers  


Which is the Best plateform for PHP?

7 Answers   DLF, Net Solution,


Categories