Forum Moderators: coopster
I have an expression that checks the validity of an e-mail address and an expression that creates a user name based on first/last name.
How do I add support to these expressions for French accents that PHP, MySQL and HTML can handle? Do I use HTML entities, unicode, URL encoding, etc.?
Here's the two expressions that are currently removing french accents.
User Name Creation
$prefix = substr($szFirstName, 0, 1);
$szLoginName = $prefix . $szLastName;
$szLoginName = strtolower($szLoginName);
$szFirstName = eregi_replace("[^a-z-]", "", $szFirstName);
$szLastName = eregi_replace("[^a-z-]", "", $szLastName)
E-mail Validity Check
ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{¦}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{¦}~] +\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{¦}~]+$', $szEmail)
[edited by: jatar_k at 8:47 pm (utc) on Sep. 11, 2002]
[edit reason] added space in ereg to stop sidescroll [/edit]
[webmasterworld.com...]