I have a application where I store sting as it is but while dispying, I want special characters to be converted to their HTML name like for < will be <. To achieve it, I am using php inbuilt function htmlspecialchars.
Output of text with this function is achieved with following code
$reviewTxt = htmlspecialchars($reviewTxt);
echo $reviewTxt;
Now, for reviewTxt to be 'I loved you <3', it should produce I loved you <3 but should display the original text. In my case, it displays the encoded data I loved you <3. I also tried to paste I loved you <3 instead of above php code just to see if I can get original text and yes, it shows 'I loved you <3'.
I am not sure what I am missing,
<to>should be done by your web browser. Are you using your web browser to view the output of your php script?