|
|
@@ -676,7 +676,7 @@ class Validation
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Checks whether the length of a string is greater or equal to a minimal length.
|
|
|
+ * Checks whether the length of a string (in character) is greater or equal to a minimal length.
|
|
|
*
|
|
|
* @param string $check The string to test
|
|
|
* @param int $min The minimal string length
|
|
|
@@ -688,7 +688,7 @@ class Validation
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Checks whether the length of a string is smaller or equal to a maximal length..
|
|
|
+ * Checks whether the length of a string (in character) is smaller or equal to a maximal length.
|
|
|
*
|
|
|
* @param string $check The string to test
|
|
|
* @param int $max The maximal string length
|
|
|
@@ -700,6 +700,30 @@ class Validation
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Checks whether the length of a string (in bytes) is greater or equal to a minimal length.
|
|
|
+ *
|
|
|
+ * @param string $check The string to test
|
|
|
+ * @param int $min The minimal string length (in bytes)
|
|
|
+ * @return bool Success
|
|
|
+ */
|
|
|
+ public static function minLengthBytes($check, $min)
|
|
|
+ {
|
|
|
+ return strlen($check) >= $min;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Checks whether the length of a string (in bytes) is smaller or equal to a maximal length.
|
|
|
+ *
|
|
|
+ * @param string $check The string to test
|
|
|
+ * @param int $max The maximal string length
|
|
|
+ * @return bool Success
|
|
|
+ */
|
|
|
+ public static function maxLengthBytes($check, $max)
|
|
|
+ {
|
|
|
+ return strlen($check) <= $max;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Checks that a value is a monetary amount.
|
|
|
*
|
|
|
* @param string $check Value to check
|