And here is the same string, when it have been through the htmlspecialchars code.
<?php
"Here is an example of text &lt;strong&gt;with &lt;U&gt;HTML&lt;/U&gt; tags.&lt;/strong&gt;";
?>
And in the browser it will be seen as this;
Here is an example of text <strong>with <U>HTML</U> tags.</strong>
Showing the HTML tags but not parsing them in the browser.
So, as you read above, about 'htmlspecialchars', your text will be converted from containing HTML tags, into the source code, meaning that f.ex < as the tags begin with, will become
<, that is the HTML charactercode for that character. (LessThan).
So the <strong> tag will look like this:
&lt;strong&gt;
But it will in the browser be shown this way; <strong>
As your HTML codes will be converted, what can we then do to get it back to as it was written?
To get all this sourcode back, we use the other half of this htmlspecialchars PHP code. Its called 'htmlspecialchars_decode', and will do that - decode the encoded string.
So your source code that now looks like this;
Here is an example of text &lt;strong&gt;with &lt;U&gt;HTML&lt;/U&gt; tags.&lt;/strong&gt;
That can be converted back to having the real tags, as written. This will mean that the code now will not be shown as sourcecode but as genuine HTML tags, so the line will look this way then;
Here is an example of text with HTML tags.