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

How to communicate with sockets in php?

1 Answers  


What is a collection in php?

0 Answers  


How to set cookies?

0 Answers  


What is the use of return in php?

0 Answers  


What are the advantages of php mysql?

0 Answers  






What is ci in php?

0 Answers  


How can we display information of a variable and readable by a human with php?

0 Answers  


Can we run php on tomcat server?

0 Answers  


What is difference between session and cookies in php?

0 Answers  


In PHP, fgets() is used to read a file one line at a time. State Whether True or False?

0 Answers  


Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?

0 Answers  


Tell me what are the different types of errors in php?

0 Answers  


Categories