Which function will you use to convert an HTML page into a format - ProProfs Discuss
Topics
Products
Follow Us:

Which function will you use to convert an HTML page into a format that can be saved in database conveniently?



A. Stripslashes()
B. Htmlentities()
C. Htmlspecialchars()

This question is part of Professional Test for PHP Web Developers
Asked by Ksj, Last updated: May 27, 2020

+ Answer
Request

2 Answers

R. Barnes

I am a nature lover.

R. Barnes, Professional Gamer, Graduation, Oakland

Answered May 17, 2019

The correct answer to this question is B, Htmlentities(). This function has all of the same functions as Htmlspecialchars(), except for one. With Htmlentities(), all characters which have entity equivalent HTML characters are thus translated into those entities. An example of it can be found below: $str = "A 'quote' is bold";

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

// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?> Htmlentities() are a built in function on PHP. Standing for Hypertext Preprocessor, PHP is a programming language for web development. Released in 1995, PHP was influenced by many other programs including JavaScript, Java and Peri.

 

ksj

Ksj

Answered Mar 04, 2018

Htmlentities()
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.