HTML entities being converted
Permalink Browser Info Environment
Hi,
When getting my PHP block to output a price in GBP I get type into the window that it should print the output as or as
Instead of either of those being outputted, I get the the actual pound symbol.
Is there a way to stop this from happening?
Thanks, Steve
When getting my PHP block to output a price in GBP I get type into the window that it should print the output as
£
Instead of either of those being outputted, I get the the actual pound symbol.
Is there a way to stop this from happening?
Thanks, Steve
Type: | Discussion |
---|---|
Status: | New |
Hi,
I have checked the database - when I enter the HTML entity, it stores it as typed.
But when viewing the source code it shows as the Pound symbol.
Also, if I go to edit the PHP block again it gets converted in the window.
Surrounding it with the htmlentities() did produced the same problems.
Many thanks, Steve
I have checked the database - when I enter the HTML entity, it stores it as typed.
But when viewing the source code it shows as the Pound symbol.
Also, if I go to edit the PHP block again it gets converted in the window.
Surrounding it with the htmlentities() did produced the same problems.
Many thanks, Steve
I'm not sure if this is being caused by the script that saves data to the database, or if this is caused by PHP's eval() method.
You could try surrounding the content that you enter in the PHP block with htmlentities(). When eval'ed, it should instruct it to convert characters like this to the applicable HTML entity.