PHP function of the day: htmlentities()

For day 7 of 21 in the “PHP Function of the day” series, I’m going to look at htmlentities().  It takes HTML as an input and converts it to HTML entities. Let’s take a look. <?php $html = ‘<h1>Hello!</h1><p>Joe\’s website is at: <a href=”https://jws.dev”>jws.dev</a></p>’; echo ‘<br />’; echo $html; echo ‘<br />’; echo htmlentities($html); ?>   See …

Continue reading "PHP function of the day: htmlentities()"