PHP+Markup+Encoding+Text

=PHP Markup Encoding Text=

links: htmlspecialchars
(only encodes certain characters like &, ', ", <, >)

htmlentities
Like htmlspecialchars but converts anything that has a related special character such as copyright, trademark, yen, British pound, etc. Anything output to the browser should pass through htmlentities especially on the public side and especially if public is allowed to put anything into the database. This is very important because some people may add malicious HTML with javascript or SQL commands as input, which will execute in the user's browser.

strip_tags
Will strip the tags from a string but can indicate which tags to leave in by passing in as comma-separated string.

This will leave bold, breaks, paragraphs and links: code  "); ?> code

nl2br (letter n, letter l, number 2, letter b, letter r)
Stands for new line to break. Converts a new line character \n or \r to a

nl2br is applied to ($sel_page['content']) so $sel_page['content'] must be surrounded by parentheses: code  "); ?> code