Returns an array with the normalized date from an locale date
a input of 10.01.2006 without a $locale would return: array ('day' => 10, 'month' => 1, 'year' => 2006) The optional $locale parameter is only used to convert human readable day and month names to their numeric equivalents.
static
array
getDate
(
string $date, [
string $format =
null], [
string|Zend_Locale $locale =
null])
-
string
$date: Date string
-
string
$format: Date type CLDR format to parse. Only single-letter codes (H, m, s, y, M, d), and MMMM and EEEE are supported.
-
string|Zend_Locale
$locale: OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
Alias for getNumber
static
float
getFloat
(
$input, [
integer $precision =
null], [
string|Zend_Locale $locale =
null],
string $value)
-
string
$value: Number to localize
-
integer
$precision: OPTIONAL Precision of the float value, not touched if null
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
-
$input
Returns the first found integer from an string Parsing depends on given locale (grouping and decimal)
Examples for input: ' 2345.4356,1234' = 23455456 '+23,3452.123' = 233452 ' 12343 ' = 12343 '-9456km' = -9456 '0' = 0 '(-){0,1}(\d+(\.){0,1})*(\,){0,1})\d+'
static
integer
getInteger
(
string $input, [
string|Zend_Locale $locale =
null])
-
string
$input: Input string to parse for numbers
-
string|Zend_Locale
$locale: OPTIONAL locale for parsing the number format
Returns the first found number from an string Parsing depends on given locale (grouping and decimal)
Examples for input: ' 2345.4356,1234' = 23455456.1234 '+23,3452.123' = 233452.123 ' 12343 ' = 12343 '-9456km' = -9456 '0' = 0 '(-){0,1}(\d+(\.){0,1})*(\,){0,1})\d+'
static
integer|string
getNumber
(
string $input, [
integer $precision =
null], [
string|Zend_Locale $locale =
null])
-
string
$input: Input string to parse for numbers
-
integer
$precision: OPTIONAL precision of a float value, not touched if null
-
string|Zend_Locale
$locale: OPTIONAL locale for parsing the number format
Returns an array with 'hour', 'minute', and 'second' elements extracted from $time
according to the order described in $format. For a format of 'H:m:s', and an input of 11:20:55, getTime() would return: array ('hour' => 11, 'minute' => 20, 'second' => 55) The optional $locale parameter may be used to help extract times from strings containing both a time and a day or month name.
static
array
getTime
(
string $time, [
string $format =
null], [
string|Zend_Locale $locale =
null])
-
string
$time: Time string
-
string
$format: Date type CLDR format to parse. Only single-letter codes(H, m, s, y, M, d), and MMMM and EEEE are supported.
-
string|Zend_Locale
$locale: OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
Returns if the given string is a date
static
boolean
isDate
(
string $date, [
string $format =
null], [
string|Zend_Locale $locale =
null])
-
string
$date: Date string
-
string
$format: Date type CLDR format to parse. Only single-letter codes (H, m, s, y, M, d), and MMMM and EEEE are supported.
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing the date string
Returns if a float was found Alias for isNumber()
static
boolean
isFloat
(
$value, [
string|Zend_Locale $locale =
null],
string $input)
-
string
$input: Localized number string
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
-
$value
Returns if a integer was found
static
boolean
isInteger
(
$value, [
string|Zend_Locale $locale =
null],
string $input)
-
string
$input: Localized number string
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
-
$value
Checks if the input contains a normalized or localized number
static
boolean
isNumber
(
string $input, [
string|Zend_Locale $locale =
null])
-
string
$input: Localized number string
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
Returns is the given string is a time
static boolean
isTime
(string $time, [string $format = null], [locale $locale = null])
-
string
$time: Time string
-
string
$format: Time type CLDR format !!!
-
locale
$locale: OPTIONAL Locale of time string
Returns a locale formatted integer number Alias for toNumber()
static
string
toFloat
(
string $value, [
integer $precision =
null], [
string|Zend_Locale $locale =
null])
-
string
$value: Number to normalize
-
integer
$precision: OPTIONAL Precision of a float value, not touched if null
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
Returns a localized number
static
string
toInteger
(
string $value, [
string|Zend_Locale $locale =
null])
-
string
$value: Number to normalize
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
Returns a locale formatted number
static
string
toNumber
(
string $value, [
integer $precision =
null], [
string|Zend_Locale $locale =
null])
-
string
$value: Number to localize
-
integer
$precision: OPTIONAL Precision of a float value, not touched if null
-
string|Zend_Locale
$locale: OPTIONAL Locale for parsing
Changes the numbers/digits within a given string from one script to another When a script is not supported, no action is taken, so the original input will be returned So this function works the same way like translating
Examples for input: toNumberSystem('١١٠ Tests', 'Arab'); -> returns '100 Tests' Example for not supported script toNumberSystem('١١٠ Tests', 'Unkn'); -> returns '١١٠ Tests'
static string
toNumberSystem
(string $input, $from, [string $to = null], string $locale)
-
string
$input: String to convert
-
string
$locale: Script to parse, see Zend_Locale->getScriptList() for details
-
string
$to: OPTIONAL Script to convert to
-
$from