_php Tutorial to determine whether a PHP function is a string within a specified length

Source: Internet
Author: User
Copy CodeThe code is as follows:
———————————————————————————–
Function name: Checklengthbetween ($C _char, $I _len1, $I _len2=100)
Function: Determines whether the string is within the specified length
Parameters: $C _char (string to be detected)
$I _len1 (the lower bound of the target string length)
$I _len2 (upper limit of target string length)
Return Value: Boolean value
Remark: None
———————————————————————————–
function Checklengthbetween ($C _cahr, $I _len1, $I _len2=100)
{
$C _cahr = Trim ($C _cahr);
if (strlen ($C _cahr) < $I _len1) return false;
if (strlen ($C _cahr) > $I _len2) return false;
return true;
}
———————————————————————————–

http://www.bkjia.com/PHPjc/321254.html www.bkjia.com true http://www.bkjia.com/PHPjc/321254.html techarticle Copy the code as follows://——————————————————————————— –//function Name: Checklengthbetween ($C _char, $I _len1, $I _len2=100)/...

  • 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.