1
4

2 回答 2

1

Your problem is not with the htmlentity_decode($currency) part, but with the json_encode part. This will turn your euro symbol back to an htmlentity.

You could use json_encode($currency, JSON_UNESCAPED_UNICODE) to force the use of the actual € symbol, but personally I think you are better of with sending the html entity. As some browser will see that as invalid code and you'll get unexpected results.

于 2013-01-22T15:25:46.490 回答
0

I checked that by not making any changes in PHP side and explicitly decoding the HTML entities in the javascript side, after receiving response, the problem gets fixed. I added this javascript function html_entity_decode() (phpjs.org/functions/html_entity_decode) and called it before alerting the response, but that too did not work (then I added support for Euro in that function) and now it works..

于 2013-02-19T14:42:52.070 回答