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!
Comment on this Question and Answer >>>
ASK A QUESTION
More strings PHP Questions
How do I turn a string into an array?How do I check if a string contains HTML?
How can I repeat a string several times?
How do I find the position of a letter in a string in PHP?
What is the difference between print and echo?
