pendelton Posted November 1, 2006 Share Posted November 1, 2006 The follownig code works as expected in PHP 4, but not as expected in PHP 5.1.2.I have just been baffled for hours wondering why the following code prints "262145" instead of the UK pound sign.[code]define(CURRENCY_SYMBOL, '£');print CURRENCY_SYMBOL;[/code]Initially I thought that I had got my HTML code '£' mixed up. Then I eventually tried the following which also prints 262145.[code]define(CURRENCY_SYMBOL, 'hello');print CURRENCY_SYMBOL;[/code]If I use CURRENCY_SYMBOL_1 for the define then everything works as expected. It seems that CURRENCY_SYMBOL must be defined in PHP's core somewhere and also their is no way to override its value (not that I want to now that I know what is going on).Can anyone tell me what CURRENCY_SYMBOL is, and why its value is 262145 (at least on my server with my local)? Quote Link to comment Share on other sites More sharing options...
Orio Posted November 1, 2006 Share Posted November 1, 2006 If you take a look in php's [url=http://www.php.net/manual/en/reserved.constants.php]prefined constants[/url] you'll see CURRENCY_SYMBOL is a prefined constant. That's why you cant use it.Orio. Quote Link to comment Share on other sites More sharing options...
pendelton Posted November 1, 2006 Author Share Posted November 1, 2006 Thanks. I worked out that it was a pre-defined constant that has been sneaked in between PHP 4 and PHP 5. What I was wondering was what its strange value means. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.