Which function will you use to convert an HTML page into a format - ProProfs Discuss
Cancel
TopicsDown
Products Down
Follow Us:
FacebookTwitter
Advertisement

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: Sep 20, 2020

+ Answer
Request
Question menu
Vote up Vote down

2 Answers

R. Barnes

R. Barnes

I am a nature lover.

R. Barnes
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.

upvote downvote
Reply 

ksj786

ksj

ksj786
Ksj

Answered Mar 04, 2018

Htmlentities()
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

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