function is_alpha($str = '') //alpha
{
if($str == "")
{
return false; //string empty
}
elseif(ctype_alpha($str) == true)
{
return true;
}
else
{
return false; //error, there must be a character than is not a letter!
}
}
function is_num($str = '') //digits
{
if($str == "")
{
return false; //string empty!
}
elseif(ctype_digit($str) == true)
{
return true; //its a non-decimal number! (base 10)
}
else
{
return false; //error, there must be a character than is not a digit!
}
}
function is_alnum($str = '') //alphanumeric
{
if($str == "")
{
return false; //string empty
}
elseif(ctype_alnum($str) == true)
{
return true; //this is 0-9, a-z!
}
else
{
return false; //error, there must be a character that is not a digit or letter!
}
}