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

What are the different types of PHP arrays?

0 Answers  


How to copy a file?

0 Answers  


What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?

0 Answers  


is 'easyphp' is compelete technology to design a phpmysql site?

3 Answers  


How come the code works, but does not for two-dimensional array of mine?

0 Answers  


How to replace a substring in a given string in php?

0 Answers  


What are arguments in php?

0 Answers  


Code to upload a file in PHP?

0 Answers  


What is the function used to change the root directory in PHP?

0 Answers  


How is a constant defined in a PHP script?

0 Answers  


What is the difference between exception::getmessage and exception::getline?

0 Answers  


display selected value in dropdown list through javascript without page refresh

5 Answers   ASD Lab,


Categories