Try:

if (!eregi('^[a-z_\-]{0,}$', $_POST['vpis_ime']))
  echo "wrong char";

That'll sort it for everything except [ and ], which I can't find any way of
checking for :-( Anyone else have any ideas?

HTH anyway.

Danny.

----- Original Message -----
From: "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 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 if it contains only charaters
from
> a to z and chars _ - [ ] . Can somebody write me a working function ?
>
> thx in advance


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to