*
String Check Class
* @author Sanshi
qq:35047205
Email:sanshi0815@tom.com
Msn:sanshi0815@tom.com
*/
Class Checkbase
{
function Checkbase ()
{
}
/*
Used to check if a string is empty
* @param $str checked fields
* @param $isStr If the field has the possibility that the unique character is a number or bool type, use the
Returns True when empty
*/
function Strisnull ($str, $isStr =true)
{
Return $ISSTR? (Empty ($STR)? true:false)
:(isset ($str)? false:true);
}
/*
strings are compared to regular expressions
@param $str the string to compare
@param $pattern to be better than the right
Returns true on a regular match
*/
function Strcomparepattern ($STR, $pattern)
{
if (Ereg ($pattern, $STR))
{
Found the return
return true;
}
return false;
}
/*
Determine the length of a string
@param $str the string to check
@param $max Maximum Length
Minimum length of @param $min
Compliant return True
*/
function Strcomparelen ($str, $max, $min =1)
{
$len = strlen ($STR);
$max =empty ($max)? $len: $max;
Return ($len > $max | | $len < $min) false:true;
}
/*
Information processing, jump to page
@param $page Jump to the page
@param $msg Tip Information
*/
function msg ($page, $msg)
{
$msg = Empty ($msg)? "" ":" msg= ". Base64_encode ($MSG);
$url = $page. $msg;
if (@header ("Location:". $url))
{
echo " ";
}
Exit ();
}
}
http://www.bkjia.com/PHPjc/629762.html www.bkjia.com true http://www.bkjia.com/PHPjc/629762.html techarticle * String Check class * @author Sanshi qq:35047205 email:sanshi0815@tom.com msn:sanshi0815@tom.com */class Checkbase {function che Ckbase () {}/* is used to check if the string is empty ...