Re: [PHP] eregi problem

2005-04-03 Thread Josip Dzolonga
[EMAIL PROTECTED] wrote: if((eregi("[^a-zA-Z0-9]",$GP[sifre]) I think that the ^ anchor is your problem, it shall be out of the brackets : if (eregi("^[a-zA-Z0-9]+$", $GP['sifre'])) echo 'true'; else echo 'false'; (the above is tested and works perfect) P.S. Take a look here http://www.php.net/man

Re: [PHP] eregi problem

2005-04-03 Thread BAO RuiXian
[EMAIL PROTECTED] wrote: I m trying to check $GP[sifre] variable, $GP[sifre] must consist of alpha numeric chars only. here, how I check the variable: Try this: if(eregi("^[a-zA-Z0-9]+$",$GP[sifre])) The above say that between the beginning of the string "^" and the end of the string "

[PHP] eregi problem

2005-04-03 Thread emre
I m trying to check $GP[sifre] variable, $GP[sifre] must consist of alpha numeric chars only. here, how I check the variable: if((eregi("[^a-zA-Z0-9]",$GP[sifre]) echo 'true'; else echo 'false'; It works if variable starts with alphabetic chars only. for example this returns 'ok' $GP[

Re: [PHP] eregi() problem

2002-04-21 Thread Miguel Cruz
On Mon, 22 Apr 2002, Gregor Jaksa wrote: > if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"])) > echo "wrong char"; > > why does this always return "wrong char" no matter what value is in vpis_ime > ... i tried "blah", "242234" "bla242h" .. every single time i get "wrong > char". im using

Re: [PHP] eregi() problem

2002-04-21 Thread Danny Shepherd
m: "Gregor Jaksa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 22, 2002 1:04 AM Subject: [PHP] eregi() problem > if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"])) > echo "wrong char"; > > why does thi

[PHP] eregi() problem

2002-04-21 Thread Gregor Jaksa
if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"])) echo "wrong char"; why does this always return "wrong char" no matter what value is in vpis_ime ... i tried "blah", "242234" "bla242h" .. every single time i get "wrong char". im using PHP 4.1.2 basicly is what i want is to check string