[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
[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 "
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[
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
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
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
6 matches
Mail list logo