PHP string Check class _php tutorial

Source: Internet
Author: User
*
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.