RE: [PHP] is_alpha_numeric ?
I tried that, but it didn't work. if (ctype_alnum($var)) { echo ok; }else { echo no; } I got an 'undefined function' error. php4.0.4pl1 Did I miss something ? -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- On Sat, 7 Jul 2001, PHPBeginner.com wrote: check out ctype (suggested to PHP by me, btw) php.net/ctype we have all that. -Maxim Maletsky -Original Message- From: Lasse [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 07, 2001 7:40 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] is_alpha_numeric ? scott [gts] [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... you could also use this: function is_alphanum($data) { return preg_match('/^\w+$/', $data); } Watch out though... IIRC \w also includes underscore... -- Lasse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] is_alpha_numeric ?
yes, you have to enable it: --enable-ctype ...and, ctype is available only starting from PHP v.4.0.4+, ...and it is only the experimental family of functions... (this you read on the site, right?) Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: John Monfort [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 08, 2001 12:59 AM To: PHPBeginner.com Cc: Lasse; [EMAIL PROTECTED] Subject: RE: [PHP] is_alpha_numeric ? I tried that, but it didn't work. if (ctype_alnum($var)) { echo ok; }else { echo no; } I got an 'undefined function' error. php4.0.4pl1 Did I miss something ? -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- On Sat, 7 Jul 2001, PHPBeginner.com wrote: check out ctype (suggested to PHP by me, btw) php.net/ctype we have all that. -Maxim Maletsky -Original Message- From: Lasse [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 07, 2001 7:40 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] is_alpha_numeric ? scott [gts] [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... you could also use this: function is_alphanum($data) { return preg_match('/^\w+$/', $data); } Watch out though... IIRC \w also includes underscore... -- Lasse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] is_alpha_numeric ?
Hello everyone, I'm trying to determine if an argument is alphanumeric. Is there a function to do this? I thought PHP had a IS_ALPHA_NUMERIC function, but I can't seem to find it anywhere. Was it wishful thinking ? Please help. If you do know of this function, then please send me the syntax. is_alpha_numeric($string) is not working. If you do know of another way to this, then please send me that as well. My expected string has the form 'A200A'. Both, letters and numbers, will change depending on the item. The value will ve passed via a hidden form. Thanks in advance. -John __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] is_alpha_numeric ?
John Monfort [EMAIL PROTECTED] wrote: I'm trying to determine if an argument is alphanumeric. Is there a function to do this? There may be in the CVS version (would have to check), but there's not in 4.0.6. eregi( [[:alnum:]]{1,}, $string ) may do the trick. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] is_alpha_numeric ?
you could also use this: function is_alphanum($data) { return preg_match('/^\w+$/', $data); } -Original Message- From: Steve Werby [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 3:32 PM To: John Monfort; [EMAIL PROTECTED] Subject: Re: [PHP] is_alpha_numeric ? John Monfort [EMAIL PROTECTED] wrote: I'm trying to determine if an argument is alphanumeric. Is there a function to do this? There may be in the CVS version (would have to check), but there's not in 4.0.6. eregi( [[:alnum:]]{1,}, $string ) may do the trick. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] is_alpha_numeric ?
scott [gts] [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... you could also use this: function is_alphanum($data) { return preg_match('/^\w+$/', $data); } Watch out though... IIRC \w also includes underscore... -- Lasse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] is_alpha_numeric ?
check out ctype (suggested to PHP by me, btw) php.net/ctype we have all that. -Maxim Maletsky -Original Message- From: Lasse [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 07, 2001 7:40 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] is_alpha_numeric ? scott [gts] [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... you could also use this: function is_alphanum($data) { return preg_match('/^\w+$/', $data); } Watch out though... IIRC \w also includes underscore... -- Lasse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]