Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the use of the function htmlentities?

user-image
Question added by Julfkar Moh Umar , Sr. Software Engineer , Aakash Edutech Private Limited
Date Posted: 2016/01/13
Mohammad Sheraz Javed
by Mohammad Sheraz Javed , PHP Backend Engineer , Arpatech (Pvt) Ltd (Pakistan

"htmlentities" convert/translate html characters to their equivalent entities:

for example:

 

$str "A 'quote' is <b>bold</b>";echo htmlentities($str);

 

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;