KJ Saxena
KJ Saxena

Reputation: 21838

PHP function to encode & etc. characters to corresponding HTML entities

Does anybody know of a PHP function to encode strings containing special characters like & etc. to strings containing corresponding HTML entities?

The purpose is to display string data on a webpage without causing XML parsing errors.

Upvotes: 0

Views: 257

Answers (2)

RageZ
RageZ

Reputation: 27313

please see htmlentities function.

Cheers

Upvotes: 2

Sergej Andrejev
Sergej Andrejev

Reputation: 9413

htmlentities() and htmlspecialchars()

Upvotes: 2

Related Questions