What is the use of htmlspecialchars in php?



What is the use of htmlspecialchars in php?..

Answer / Sukhvir Singh

In PHP, htmlspecialchars() function converts special characters to HTML entities. This is used for displaying user-generated data (like user input) on a webpage to prevent any potential issues caused by those characters such as XSS attacks.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How to invoke a user function?

1 Answers  


how can refresh current page automatically, without press any button and anchor tag.

5 Answers  


Do you know how to get the ip address of the client?

1 Answers  


Explain me the difference between include and require?

1 Answers  


What is the most common http method?

1 Answers  


How does csrf attack work?

1 Answers  


Tell me how can we pass the variable through the navigation between the pages?

1 Answers  


What is php dependency injection?

1 Answers  


What are the advantages of php mysql?

1 Answers  


Explain setcookie() function in php?

1 Answers  


What is register_globals in php?

6 Answers   Castling IT, HCL, Intel Soft Solutions, Millennium,


What is php and what does it do?

1 Answers  


Categories