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
What is the difference between ' and "?How can I repeat a string variable several times?
How do I check if a string contains HTML?
How do I add commas easily to a string of numbers?
How do I find the position of a letter in a string in PHP?
