Thanks for you help!
I finally got it working.
Here's the code that should work.
[PHP]
function check_charators ($string)
{
if(ereg('^[A-Za-z0-9_][A-Za-z0-9_]*$', $string))
{
return true;
}
else
{
return false;
}
}
[/PHP]
I delete the "." ;)
User Profile
Collapse
-
Thanks for your reply.
I appriciated very very much.
I would like to know, how can I use a if to prevent this from happening?
Thanks!Leave a comment:
-
Sure I did.
I thought they are the same thing, other than the fact that eregi is not case-sensitive.Leave a comment:
-
Check if a string only contains "A-Za-z0-9_" and "."
Hi all!
I'm new here!
I was wondering how I can check if a string contains only "A-Za-z0-9_" and ".".
I tried the following code
[php]
function check_validstri ng($check_valid string)
{
if(eregi('[A-Za-z0-9_.]',$check_valids tring))
{
return true;
}
else
{
return false;
}
[/php]
The result...
No activity results to display
Show More
Leave a comment: