473,499 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checking for Euro currency symbol in regexp

Hi, I want to check that a string entered via a from contains the only
cdertain characters including the Euro currency symbol using a reg exp
in PHP.

I've set my web page to use charset=iso-8859-15 and tried

$allowed = "[^-a-zA-Z0-9.:,!+£$ \\ ". chr(128) ."]";
if ( ereg( $allowed, $str) )
but the ereg regects any string containing the symbol.

Any help would be great,

Kevin
Jul 17 '05 #1
1 3839
On 3 Dec 2003 09:32:56 -0800, km******@yahoo.co.uk (Kevin) wrote:
Hi, I want to check that a string entered via a from contains the only
cdertain characters including the Euro currency symbol using a reg exp
in PHP.

I've set my web page to use charset=iso-8859-15 and tried

$allowed = "[^-a-zA-Z0-9.:,!+£$ \\ ". chr(128) ."]";
if ( ereg( $allowed, $str) )

but the ereg regects any string containing the symbol.


128 is not a valid printable character in iso-8859-15.
The code for Euro is 164.
http://en.wikipedia.org/wiki/ISO_8859-15

It's only 128 in Microsoft Codepage 1252.
http://www.kostis.net/charsets/cp1252.htm

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
25910
by: Robert Zierhofer | last post by:
hi there, it seems as if i can´t convert the euro and pound sign to their html equivalents. i tried eregi_replace("€", "€", $haystack); eregi_replace("£", "£", $haystack); as...
11
12781
by: MH | last post by:
Thai may have been asked before but I'm new here.... How can I put the Euro symbol, ? using alt0128 in my page and get it validated as HTML 4.01 ? -------------- MH
18
6485
by: gabriel | last post by:
greetings, I am currently working on a website where I need to print the Euro symbol and some "oe" like in "oeuvre". If I choose this : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
2
4599
by: tilmann | last post by:
We are using ASCII-Tablespaces with the Codepage 819 on z/OS. We're now having a problem with the EURO symbol. The data is inserted from a Windows-Client, running Codepage 1252. The Euro symbol is...
0
1293
by: ashish | last post by:
hi All, Iam having a webapplication which when run under French culture info displays value of euro currency in this format 0.00 E, (E being the euro symbol, dont know how to type it here ) ...
8
3662
by: Max | last post by:
My client has decided to use the Euro for the entire web site. Is there an easy way to get my ASP.NET app to format currency to Euro instead of US-dollar? Right now it's just reading the server...
7
3300
by: kingski | last post by:
Any idea about this ? http://www.developerfusion.co.uk/forums/thread/114379/#114379 "Can any one help me as i am building a shopping cart and it supports multiple currencies but while sending...
2
3969
by: nagarwal | last post by:
Hi All, i am facing a very typical problem ..where i need to display the currency Euro symbol onto the jsp page. i could have done it using the java.util.Currency class but i cannot set the...
7
6487
by: brucedodds | last post by:
The system I support exists to generate invoices to send to European clients. Currency values in these reports must be represented as Euros with European conventions (comma for decimal; dot for...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.