1/* EXAMPLE: <p>Bed & Breakfast</p> --> <p>Bed & Breakfast</p>
2 & &
3 " " (unless ENT_NOQUOTES is set)
4 ' ' or ' (ENT_QUOTES must be set)
5 < <
6 > > */
7
8<?php
9$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
10echo $new; // <a href='test'>Test</a>
11?>1
2 <?php
3$str = "This is some <b>bold</b> text.";
4echo htmlspecialchars($str);
5
6 ?> 1$string = "This is testing message "ETC" ";
2htmlspecialchars($string, ENT_COMPAT)