initial commit of validation classes.

This commit is contained in:
Taylor Otwell
2011-06-21 20:11:17 -05:00
parent adb583471b
commit 081a3e512f
13 changed files with 799 additions and 0 deletions

View File

@@ -46,6 +46,17 @@ class Str {
return (function_exists('mb_convert_case')) ? mb_convert_case($value, MB_CASE_TITLE, Config::get('application.encoding')) : ucwords(strtolower($value));
}
/**
* Get the length of a string.
*
* @param string $value
* @return int
*/
public static function length($value)
{
return function_exists('mb_strlen') ? mb_strlen($value, Config::get('application.encoding')) : strlen($value);
}
/**
* Generate a random alpha or alpha-numeric string.
*