Home > Backend Development > PHP Tutorial > PHP function to convert integer to string to determine whether it is a string within a specified length

PHP function to convert integer to string to determine whether it is a string within a specified length

WBOY
Release: 2016-07-29 08:41:58
Original
977 people have browsed it

Copy code The code is as follows:


//——————————————————————————————–
// Function name: CheckLengthBetween ($C_char, $I_len1, $I_len2=100)
// Function: Determine whether it is a string within the specified length
// Parameter: $C_char (string to be detected)
// $I_len1 (target string length) Lower limit)
// $I_len2 (the upper limit of the target string length)
// Return value: Boolean value
// Remarks: 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;
}
//—————————————————————— —————–

The above introduces the PHP function for converting integer to string to determine whether it is a string within a specified length, including the content of converting integer to string. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template