Better PHP Documentation
opinionated
Open main menu
Get Started
Documentation
Community
Training
Better PHP Documentation
Close menu
Get Started
Documentation
Community
Training
Log in
Change language:
English
German
Spanish
French
Italian
Japanese
Brazilian Portuguese
Russian
Turkish
Ukrainian
Chinese (Simplified)
Other
Internationalization Functions
Introduction
Installing/Configuring
Requirements
Installation
Runtime Configuration
Predefined Constants
Examples
Basic usage of this extension
Collator
β The Collator class
Collator::asort
β Sort array maintaining index association
Collator::compare
β Compare two Unicode strings
Collator::__construct
β Create a collator
Collator::create
β Create a collator
Collator::getAttribute
β Get collation attribute value
Collator::getErrorCode
β Get collator's last error code
Collator::getErrorMessage
β Get text for collator's last error code
Collator::getLocale
β Get the locale name of the collator
Collator::getSortKey
β Get sorting key for a string
Collator::getStrength
β Get current collation strength
Collator::setAttribute
β Set collation attribute
Collator::setStrength
β Set collation strength
Collator::sort
β Sort array using specified collator
Collator::sortWithSortKeys
β Sort array using specified collator and sort keys
NumberFormatter
β The NumberFormatter class
NumberFormatter::create
β Create a number formatter
NumberFormatter::format
β Format a number
NumberFormatter::formatCurrency
β Format a currency value
NumberFormatter::getAttribute
β Get an attribute
NumberFormatter::getErrorCode
β Get formatter's last error code
NumberFormatter::getErrorMessage
β Get formatter's last error message
NumberFormatter::getLocale
β Get formatter locale
NumberFormatter::getPattern
β Get formatter pattern
NumberFormatter::getSymbol
β Get a symbol value
NumberFormatter::getTextAttribute
β Get a text attribute
NumberFormatter::parse
β Parse a number
NumberFormatter::parseCurrency
β Parse a currency number
NumberFormatter::setAttribute
β Set an attribute
NumberFormatter::setPattern
β Set formatter pattern
NumberFormatter::setSymbol
β Set a symbol value
NumberFormatter::setTextAttribute
β Set a text attribute
Locale
β The Locale class
Locale::acceptFromHttp
β Tries to find out best available locale based on HTTP "Accept-Language" header
Locale::canonicalize
β Canonicalize the locale string
Locale::composeLocale
β Returns a correctly ordered and delimited locale ID
Locale::filterMatches
β Checks if a language tag filter matches with locale
Locale::getAllVariants
β Gets the variants for the input locale
Locale::getDefault
β Gets the default locale value from the INTL global 'default_locale'
Locale::getDisplayLanguage
β Returns an appropriately localized display name for language of the inputlocale
Locale::getDisplayName
β Returns an appropriately localized display name for the input locale
Locale::getDisplayRegion
β Returns an appropriately localized display name for region of the input locale
Locale::getDisplayScript
β Returns an appropriately localized display name for script of the input locale
Locale::getDisplayVariant
β Returns an appropriately localized display name for variants of the input locale
Locale::getKeywords
β Gets the keywords for the input locale
Locale::getPrimaryLanguage
β Gets the primary language for the input locale
Locale::getRegion
β Gets the region for the input locale
Locale::getScript
β Gets the script for the input locale
Locale::lookup
β Searches the language tag list for the best match to the language
Locale::parseLocale
β Returns a key-value array of locale ID subtag elements
Locale::setDefault
β Sets the default runtime locale
Normalizer
β The Normalizer class
Normalizer::getRawDecomposition
β Gets the Decomposition_Mapping property for the given UTF-8 encoded code point
Normalizer::isNormalized
β Checks if the provided string is already in the specified normalization form
Normalizer::normalize
β Normalizes the input provided and returns the normalized string
MessageFormatter
β The MessageFormatter class
MessageFormatter::create
β Constructs a new Message Formatter
MessageFormatter::format
β Format the message
MessageFormatter::formatMessage
β Quick format message
MessageFormatter::getErrorCode
β Get the error code from last operation
MessageFormatter::getErrorMessage
β Get the error text from the last operation
MessageFormatter::getLocale
β Get the locale for which the formatter was created
MessageFormatter::getPattern
β Get the pattern used by the formatter
MessageFormatter::parse
β Parse input string according to pattern
MessageFormatter::parseMessage
β Quick parse input string
MessageFormatter::setPattern
β Set the pattern used by the formatter
IntlCalendar
β The IntlCalendar class
IntlCalendar::add
β Add a (signed) amount of time to a field
IntlCalendar::after
β Whether this objectΚΌs time is after that of the passed object
IntlCalendar::before
β Whether this objectΚΌs time is before that of the passed object
IntlCalendar::clear
β Clear a field or all fields
IntlCalendar::__construct
β Private constructor for disallowing instantiation
IntlCalendar::createInstance
β Create a new IntlCalendar
IntlCalendar::equals
β Compare time of two IntlCalendar objects for equality
IntlCalendar::fieldDifference
β Calculate difference between given time and this objectΚΌs time
IntlCalendar::fromDateTime
β Create an IntlCalendar from a DateTime object or string
IntlCalendar::get
β Get the value for a field
IntlCalendar::getActualMaximum
β The maximum value for a field, considering the objectΚΌs current time
IntlCalendar::getActualMinimum
β The minimum value for a field, considering the objectΚΌs current time
IntlCalendar::getAvailableLocales
β Get array of locales for which there is data
IntlCalendar::getDayOfWeekType
β Tell whether a day is a weekday, weekend or a day that has a transition between the two
IntlCalendar::getErrorCode
β Get last error code on the object
IntlCalendar::getErrorMessage
β Get last error message on the object
IntlCalendar::getFirstDayOfWeek
β Get the first day of the week for the calendarΚΌs locale
IntlCalendar::getGreatestMinimum
β Get the largest local minimum value for a field
IntlCalendar::getKeywordValuesForLocale
β Get set of locale keyword values
IntlCalendar::getLeastMaximum
β Get the smallest local maximum for a field
IntlCalendar::getLocale
β Get the locale associated with the object
IntlCalendar::getMaximum
β Get the global maximum value for a field
IntlCalendar::getMinimalDaysInFirstWeek
β Get minimal number of days the first week in a year or month can have
IntlCalendar::getMinimum
β Get the global minimum value for a field
IntlCalendar::getNow
β Get number representing the current time
IntlCalendar::getRepeatedWallTimeOption
β Get behavior for handling repeating wall time
IntlCalendar::getSkippedWallTimeOption
β Get behavior for handling skipped wall time
IntlCalendar::getTime
β Get time currently represented by the object
IntlCalendar::getTimeZone
β Get the objectΚΌs timezone
IntlCalendar::getType
β Get the calendar type
IntlCalendar::getWeekendTransition
β Get time of the day at which weekend begins or ends
IntlCalendar::inDaylightTime
β Whether the objectΚΌs time is in Daylight Savings Time
IntlCalendar::isEquivalentTo
β Whether another calendar is equal but for a different time
IntlCalendar::isLenient
β Whether date/time interpretation is in lenient mode
IntlCalendar::isSet
β Whether a field is set
IntlCalendar::isWeekend
β Whether a certain date/time is in the weekend
IntlCalendar::roll
β Add value to field without carrying into more significant fields
IntlCalendar::set
β Set a time field or several common fields at once
IntlCalendar::setDate
β Set a date fields
IntlCalendar::setDateTime
β Set a date and time fields
IntlCalendar::setFirstDayOfWeek
β Set the day on which the week is deemed to start
IntlCalendar::setLenient
β Set whether date/time interpretation is to be lenient
IntlCalendar::setMinimalDaysInFirstWeek
β Set minimal number of days the first week in a year or month can have
IntlCalendar::setRepeatedWallTimeOption
β Set behavior for handling repeating wall times at negative timezone offset transitions
IntlCalendar::setSkippedWallTimeOption
β Set behavior for handling skipped wall times at positive timezone offset transitions
IntlCalendar::setTime
β Set the calendar time in milliseconds since the epoch
IntlCalendar::setTimeZone
β Set the timezone used by this calendar
IntlCalendar::toDateTime
β Convert an IntlCalendar into a DateTime object
IntlGregorianCalendar
β The IntlGregorianCalendar class
IntlGregorianCalendar::__construct
β Create the Gregorian Calendar class
IntlGregorianCalendar::createFromDate
β Create a new IntlGregorianCalendar instance from date
IntlGregorianCalendar::createFromDateTime
β Create a new IntlGregorianCalendar instance from date and time
IntlGregorianCalendar::getGregorianChange
β Get the Gregorian Calendar change date
IntlGregorianCalendar::isLeapYear
β Determine if the given year is a leap year
IntlGregorianCalendar::setGregorianChange
β Set the Gregorian Calendar the change date
IntlTimeZone
β The IntlTimeZone class
IntlTimeZone::__construct
β Private constructor to disallow direct instantiation
IntlTimeZone::countEquivalentIDs
β Get the number of IDs in the equivalency group that includes the given ID
IntlTimeZone::createDefault
β Create a new copy of the default timezone for this host
IntlTimeZone::createEnumeration
β Get an enumeration over time zone IDs associated with the given country or offset
IntlTimeZone::createTimeZone
β Create a timezone object for the given ID
IntlTimeZone::createTimeZoneIDEnumeration
β Get an enumeration over system time zone IDs with the given filter conditions
IntlTimeZone::fromDateTimeZone
β Create a timezone object from DateTimeZone
IntlTimeZone::getCanonicalID
β Get the canonical system timezone ID or the normalized custom time zone ID for the given time zone ID
IntlTimeZone::getDisplayName
β Get a name of this time zone suitable for presentation to the user
IntlTimeZone::getDSTSavings
β Get the amount of time to be added to local standard time to get local wall clock time
IntlTimeZone::getEquivalentID
β Get an ID in the equivalency group that includes the given ID
IntlTimeZone::getErrorCode
β Get last error code on the object
IntlTimeZone::getErrorMessage
β Get last error message on the object
IntlTimeZone::getGMT
β Create GMT (UTC) timezone
IntlTimeZone::getID
β Get timezone ID
IntlTimeZone::getIDForWindowsID
β Translate a Windows timezone into a system timezone
IntlTimeZone::getOffset
β Get the time zone raw and GMT offset for the given moment in time
IntlTimeZone::getRawOffset
β Get the raw GMT offset (before taking daylight savings time into account
IntlTimeZone::getRegion
β Get the region code associated with the given system time zone ID
IntlTimeZone::getTZDataVersion
β Get the timezone data version currently used by ICU
IntlTimeZone::getUnknown
β Get the "unknown" time zone
IntlTimeZone::getWindowsID
β Translate a system timezone into a Windows timezone
IntlTimeZone::hasSameRules
β Check if this zone has the same rules and offset as another zone
IntlTimeZone::toDateTimeZone
β Convert to DateTimeZone object
IntlTimeZone::useDaylightTime
β Check if this time zone uses daylight savings time
IntlDateFormatter
β The IntlDateFormatter class
IntlDateFormatter::create
β Create a date formatter
IntlDateFormatter::format
β Format the date/time value as a string
IntlDateFormatter::formatObject
β Formats an object
IntlDateFormatter::getCalendar
β Get the calendar type used for the IntlDateFormatter
IntlDateFormatter::getDateType
β Get the datetype used for the IntlDateFormatter
IntlDateFormatter::getErrorCode
β Get the error code from last operation
IntlDateFormatter::getErrorMessage
β Get the error text from the last operation
IntlDateFormatter::getLocale
β Get the locale used by formatter
IntlDateFormatter::getPattern
β Get the pattern used for the IntlDateFormatter
IntlDateFormatter::getTimeType
β Get the timetype used for the IntlDateFormatter
IntlDateFormatter::getTimeZoneId
β Get the timezone-id used for the IntlDateFormatter
IntlDateFormatter::getCalendarObject
β Get copy of formatterΚΌs calendar object
IntlDateFormatter::getTimeZone
β Get formatterΚΌs timezone
IntlDateFormatter::isLenient
β Get the lenient used for the IntlDateFormatter
IntlDateFormatter::localtime
β Parse string to a field-based time value
IntlDateFormatter::parse
β Parse string to a timestamp value
IntlDateFormatter::setCalendar
β Sets the calendar type used by the formatter
IntlDateFormatter::setLenient
β Set the leniency of the parser
IntlDateFormatter::setPattern
β Set the pattern used for the IntlDateFormatter
IntlDateFormatter::setTimeZone
β Sets formatterΚΌs timezone
ResourceBundle
β The ResourceBundle class
ResourceBundle::count
β Get number of elements in the bundle
ResourceBundle::create
β Create a resource bundle
ResourceBundle::get
β Get data from the bundle
ResourceBundle::getErrorCode
β Get bundle's last error code
ResourceBundle::getErrorMessage
β Get bundle's last error message
ResourceBundle::getLocales
β Get supported locales
Spoofchecker
β The Spoofchecker class
Spoofchecker::areConfusable
β Checks if given strings can be confused
Spoofchecker::__construct
β Constructor
Spoofchecker::isSuspicious
β Checks if a given text contains any suspicious characters
Spoofchecker::setAllowedLocales
β Locales to use when running checks
Spoofchecker::setChecks
β Set the checks to run
Spoofchecker::setRestrictionLevel
β Set the restriction level
Transliterator
β The Transliterator class
Transliterator::__construct
β Private constructor to deny instantiation
Transliterator::create
β Create a transliterator
Transliterator::createFromRules
β Create transliterator from rules
Transliterator::createInverse
β Create an inverse transliterator
Transliterator::getErrorCode
β Get last error code
Transliterator::getErrorMessage
β Get last error message
Transliterator::listIDs
β Get transliterator IDs
Transliterator::transliterate
β Transliterate a string
IntlBreakIterator
β The IntlBreakIterator class
IntlBreakIterator::__construct
β Private constructor for disallowing instantiation
IntlBreakIterator::createCharacterInstance
β Create break iterator for boundaries of combining character sequences
IntlBreakIterator::createCodePointInstance
β Create break iterator for boundaries of code points
IntlBreakIterator::createLineInstance
β Create break iterator for logically possible line breaks
IntlBreakIterator::createSentenceInstance
β Create break iterator for sentence breaks
IntlBreakIterator::createTitleInstance
β Create break iterator for title-casing breaks
IntlBreakIterator::createWordInstance
β Create break iterator for word breaks
IntlBreakIterator::current
β Get index of current position
IntlBreakIterator::first
β Set position to the first character in the text
IntlBreakIterator::following
β Advance the iterator to the first boundary following specified offset
IntlBreakIterator::getErrorCode
β Get last error code on the object
IntlBreakIterator::getErrorMessage
β Get last error message on the object
IntlBreakIterator::getLocale
β Get the locale associated with the object
IntlBreakIterator::getPartsIterator
β Create iterator for navigating fragments between boundaries
IntlBreakIterator::getText
β Get the text being scanned
IntlBreakIterator::isBoundary
β Tell whether an offset is a boundaryΚΌs offset
IntlBreakIterator::last
β Set the iterator position to index beyond the last character
IntlBreakIterator::next
β Advance the iterator the next boundary
IntlBreakIterator::preceding
β Set the iterator position to the first boundary before an offset
IntlBreakIterator::previous
β Set the iterator position to the boundary immediately before the current
IntlBreakIterator::setText
β Set the text being scanned
IntlRuleBasedBreakIterator
β The IntlRuleBasedBreakIterator class
IntlRuleBasedBreakIterator::__construct
β Create iterator from ruleset
IntlRuleBasedBreakIterator::getBinaryRules
β Get the binary form of compiled rules
IntlRuleBasedBreakIterator::getRules
β Get the rule set used to create this object
IntlRuleBasedBreakIterator::getRuleStatus
β Get the largest status value from the break rules that determined the current break position
IntlRuleBasedBreakIterator::getRuleStatusVec
β Get the status values from the break rules that determined the current break position
IntlCodePointBreakIterator
β The IntlCodePointBreakIterator class
IntlCodePointBreakIterator::getLastCodePoint
β Get last code point passed over after advancing or receding the iterator
IntlDatePatternGenerator
β The IntlDatePatternGenerator class
IntlDatePatternGenerator::create
β Creates a new IntlDatePatternGenerator instance
IntlDatePatternGenerator::getBestPattern
β Determines the most suitable date/time format
IntlPartsIterator
β The IntlPartsIterator class
IntlPartsIterator::getBreakIterator
β Get IntlBreakIterator backing this parts iterator
UConverter
β The UConverter class
UConverter::__construct
β Create UConverter object
UConverter::convert
β Convert string from one charset to another
UConverter::fromUCallback
β Default "from" callback function
UConverter::getAliases
β Get the aliases of the given name
UConverter::getAvailable
β Get the available canonical converter names
UConverter::getDestinationEncoding
β Get the destination encoding
UConverter::getDestinationType
β Get the destination converter type
UConverter::getErrorCode
β Get last error code on the object
UConverter::getErrorMessage
β Get last error message on the object
UConverter::getSourceEncoding
β Get the source encoding
UConverter::getSourceType
β Get the source converter type
UConverter::getStandards
β Get standards associated to converter names
UConverter::getSubstChars
β Get substitution chars
UConverter::reasonText
β Get string representation of the callback reason
UConverter::setDestinationEncoding
β Set the destination encoding
UConverter::setSourceEncoding
β Set the source encoding
UConverter::setSubstChars
β Set the substitution chars
UConverter::toUCallback
β Default "to" callback function
UConverter::transcode
β Convert a string from one character encoding to another
Grapheme Functions
grapheme_extract
β Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8
grapheme_str_split
β Split a string into an array
grapheme_stripos
β Find position (in grapheme units) of first occurrence of a case-insensitive string
grapheme_stristr
β Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack
grapheme_strlen
β Get string length in grapheme units
grapheme_strpos
β Find position (in grapheme units) of first occurrence of a string
grapheme_strripos
β Find position (in grapheme units) of last occurrence of a case-insensitive string
grapheme_strrpos
β Find position (in grapheme units) of last occurrence of a string
grapheme_strstr
β Returns part of haystack string from the first occurrence of needle to the end of haystack
grapheme_substr
β Return part of a string
IDN Functions
idn_to_ascii
β Convert domain name to IDNA ASCII form
idn_to_utf8
β Convert domain name from IDNA ASCII to Unicode
IntlChar
IntlChar::charAge
β Get the "age" of the code point
IntlChar::charDigitValue
β Get the decimal digit value of a decimal digit character
IntlChar::charDirection
β Get bidirectional category value for a code point
IntlChar::charFromName
β Find Unicode character by name and return its code point value
IntlChar::charMirror
β Get the "mirror-image" character for a code point
IntlChar::charName
β Retrieve the name of a Unicode character
IntlChar::charType
β Get the general category value for a code point
IntlChar::chr
β Return Unicode character by code point value
IntlChar::digit
β Get the decimal digit value of a code point for a given radix
IntlChar::enumCharNames
β Enumerate all assigned Unicode characters within a range
IntlChar::enumCharTypes
β Enumerate all code points with their Unicode general categories
IntlChar::foldCase
β Perform case folding on a code point
IntlChar::forDigit
β Get character representation for a given digit and radix
IntlChar::getBidiPairedBracket
β Get the paired bracket character for a code point
IntlChar::getBlockCode
β Get the Unicode allocation block containing a code point
IntlChar::getCombiningClass
β Get the combining class of a code point
IntlChar::getFC_NFKC_Closure
β Get the FC_NFKC_Closure property for a code point
IntlChar::getIntPropertyMaxValue
β Get the max value for a Unicode property
IntlChar::getIntPropertyMinValue
β Get the min value for a Unicode property
IntlChar::getIntPropertyValue
β Get the value for a Unicode property for a code point
IntlChar::getNumericValue
β Get the numeric value for a Unicode code point
IntlChar::getPropertyEnum
β Get the property constant value for a given property name
IntlChar::getPropertyName
β Get the Unicode name for a property
IntlChar::getPropertyValueEnum
β Get the property value for a given value name
IntlChar::getPropertyValueName
β Get the Unicode name for a property value
IntlChar::getUnicodeVersion
β Get the Unicode version
IntlChar::hasBinaryProperty
β Check a binary Unicode property for a code point
IntlChar::isalnum
β Check if code point is an alphanumeric character
IntlChar::isalpha
β Check if code point is a letter character
IntlChar::isbase
β Check if code point is a base character
IntlChar::isblank
β Check if code point is a "blank" or "horizontal space" character
IntlChar::iscntrl
β Check if code point is a control character
IntlChar::isdefined
β Check whether the code point is defined
IntlChar::isdigit
β Check if code point is a digit character
IntlChar::isgraph
β Check if code point is a graphic character
IntlChar::isIDIgnorable
β Check if code point is an ignorable character
IntlChar::isIDPart
β Check if code point is permissible in an identifier
IntlChar::isIDStart
β Check if code point is permissible as the first character in an identifier
IntlChar::isISOControl
β Check if code point is an ISO control code
IntlChar::isJavaIDPart
β Check if code point is permissible in a Java identifier
IntlChar::isJavaIDStart
β Check if code point is permissible as the first character in a Java identifier
IntlChar::isJavaSpaceChar
β Check if code point is a space character according to Java
IntlChar::islower
β Check if code point is a lowercase letter
IntlChar::isMirrored
β Check if code point has the Bidi_Mirrored property
IntlChar::isprint
β Check if code point is a printable character
IntlChar::ispunct
β Check if code point is punctuation character
IntlChar::isspace
β Check if code point is a space character
IntlChar::istitle
β Check if code point is a titlecase letter
IntlChar::isUAlphabetic
β Check if code point has the Alphabetic Unicode property
IntlChar::isULowercase
β Check if code point has the Lowercase Unicode property
IntlChar::isupper
β Check if code point has the general category "Lu" (uppercase letter)
IntlChar::isUUppercase
β Check if code point has the Uppercase Unicode property
IntlChar::isUWhiteSpace
β Check if code point has the White_Space Unicode property
IntlChar::isWhitespace
β Check if code point is a whitespace character according to ICU
IntlChar::isxdigit
β Check if code point is a hexadecimal digit
IntlChar::ord
β Return Unicode code point value of character
IntlChar::tolower
β Make Unicode character lowercase
IntlChar::totitle
β Make Unicode character titlecase
IntlChar::toupper
β Make Unicode character uppercase
IntlException
β Exception class for intl errors
IntlIterator
β The IntlIterator class
IntlIterator::current
β Get the current element
IntlIterator::key
β Get the current key
IntlIterator::next
β Move forward to the next element
IntlIterator::rewind
β Rewind the iterator to the first element
IntlIterator::valid
β Check if current position is valid
intl Functions
intl_error_name
β Get symbolic name for a given error code
intl_get_error_code
β Get the last error code
intl_get_error_message
β Get description of the last error
intl_is_failure
β Check whether the given error code indicates failure
Found A Problem?
Learn How To Improve This Page
β’
Submit a Pull Request
β’
Report a Bug
οΌ
add a note
User Contributed Notes
There are no user contributed notes for this page.
0
pcntl_sigtimedwait
Waits for signals, with a timeout
0
similar_text
Calculate the similarity between two strings
0
boolval
Get the boolean value of a variable
0
curl_multi_close
Close a set of cURL handles
0
imap_body
Read the message body
0
mb_strpos
Find position of first occurrence of string in a string
0
pg_send_prepare
Sends a request to create a prepared statement with the given parameters, without waiting for completion
0
swoole_native_socket_bind
0
Arr::prependKeysWith
0
zend_version
Gets the version of the current Zend engine
^