Page 1 of 1

how to use eregi to only allow characters and underscore?

Posted: Sat Apr 11, 2009 4:57 am
by modpriest
i new to php, how to use eregi to only allow characters and underscore? because http://us.php.net/manual/en/function.eregi.php only show basic usage of eregi! can anyone teach me or show me the code? please help me :? :?

Re: how to use eregi to only allow characters and underscore?

Posted: Sat Apr 11, 2009 5:03 am
by Apollo

Code: Select all

if (!eregi('^[a-z_]*$',$yourString)) die('your string does not fit my needs madam!');