<?PHP
// Version 0.0.1
// Text Check is tools for words filtering and checking
class TextCheck
{
function worddigitonly($_str)
{
if (ereg("[A-Z a-z0-9]+", $_str, $regs))
return true;
else
return false;
}
function checkDirectoryName($_str)
{
return TextCheck::checkPath($_str);
}
function checkFileName($_str)
{
return TextCheck::checkPath($_str);;
}
function checkPath($_str)
{
if (ereg("[A-Z a-z0-9/~]+", $_str, $_regs))
return true;
else
return false;
}
function emailpattern($_str)
{
if (eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $_str))
{
return TRUE;
}
else
return FALSE;
}
}
?>