src/Service/validateService.php
public function betweenLength($value, $min, $max)
    {
        if ((int) $min > (int) $max) {
            $tmp = $min;
            $min = $max;
            $max = $tmp;
        }
        $this->errorMessage = null;
        $result = false;
        if (function_exists("mb_strlen")) {
            if (mb_strlen($value, 'UTF-8') <= $max && mb_strlen($value, 'UTF-8') >= $min) {
                $result = true;
            }
        } else {
            if (strlen($value) <= $max && strlen($value) >= $min) {
                $result = true;
            }
        }
        if (!$result) {
            $this->errorMessage = MessageHelper::getMessage("VALIDATESVC_BETWEEN_LENGTH", array($this->fieldNameMask, $min, $max));
        }
        return $result;
    }
public function betweenLength($value, $min, $max)
    {
        if ((int) $min > (int) $max) {
            $tmp = $min;
            $min = $max;
            $max = $tmp;
        }
        $this->errorMessage = null;
        $result = false;
        if (function_exists("mb_strlen")) {
            if (mb_strlen($value, 'UTF-8') <= $max && mb_strlen($value, 'UTF-8') >= $min) {
                $result = true;
            }
        } else {
            if (strlen($value) <= $max && strlen($value) >= $min) {
                $result = true;
            }
        }
        if (!$result) {
            $this->errorMessage = MessageHelper::getMessage("VALIDATESVC_BETWEEN_LENGTH", array($this->fieldNameMask, $min, $max));
        }
        return $result;
    }
Function to check if a value is between a $min and $max length

@param string $value
@param integer $max
@param integer $min
@return boolean Valid?