You are here: Re: [PHP] problem with currency signs « PHP « IT news, forums, messages
Re: [PHP] problem with currency signs

Posted by tedd on 01/10/06 00:36

Angelo:

Now might be the time to start looking at Unicode characters.

Here's a start:

http://www1.tip.nl/~t876506/utf8tbl.html

There's all sorts of ways to show special characters.

For example, the BULLET (Unicode 2022) can be shown by:

•
•
&#8226; <-- Note

Please note that "8226" is DEC for the HEX value
of 2202 (Unicode code point for BULLET). As such,
if you find the Unicode code point for the
character you want, all you have to do is: 1) to
convert it to DEC; 2) add the prefix of "&#" and
the suffix of ";" 3) and you'll have a character
that will be shown in browsers.

So, my advice would be to store the DEC value of
the currency label and not worry about comparing
glyphs, which may not be consistent across
browsers and OS's. Whereas, Unicode will be
consistent.

tedd

---


>Hi guys,
>
>Im having problems with the Euro and Pound
>currency signs and storing them etc...
>
>here is my scenario. I have a menu/list of
>currencies available for selection, HTML below
>for the signs:
>
>$
>&pound;
>&euro;
>
>When listed in the browser they show fine.
>When I want to save them, they are saved as the
>actual sign in the DB and not the HTML code for
>the symbol, which isnt a train smash, however,
>when I try compare the values in the DB with the
>predefined list of currency symbols, I get some
>problems.
>
>The below if statement doesnt seem to resolve:
>
>
>if ($row['p_currency'] == "¤") //where ¤ is also the value in the DB
>
>
>even if the value is ¤, or &euro; it still never reverts to true...
>
>So is there a special way I should be treating
>the symbols and maybe a special way I should be
>storing them? or comparing them?
>
>thanks in advance
>
>
>--
>
>Angelo
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--
--------------------------------------------------------------------------------
http://sperling.com/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация