How do I convert relevant characters in a string to HTML entities?
<?php
$mystring = "I said <ignore me then!>you <b>are a little bit</b> whack!";
echo htmlentities($mystring);
?>
Run it and see what happens!
More strings PHP Questions
How do I print text to the screen?How do I make sure a string is a certain length?
How do I display newline characters on a webpage?
How can I remove trailing space from a string?
How do I extract the values of variables from a string?