$string = "The quick brown fox & jumps over the lazy dog"; $html_string = htmlentities($string); echo $html_string;