I am saving HTML to a MySQL database. The HTML is posted back from the front-end. I get an issue where certain characters are 'unescaped' by the front-end (rightly so) but I need to 'escape' them again prior to saving the HTML to the database.
As an example; the browser gets sent the following:
<p style-id=".btn-widget > a">foo</p>
The browser then sends back something like:
<p style-id=".btn-widget > a">clients custom text</p>
Note the >
is now a >
. I need to escape this before saving this HTML to the MySQL database.
Is there a PHP function that can do this for me?