Text
class Text (View source)
Text manipulation utility class
Constants
| WORD_CASELESS |
|
| CODE_CASE_SEPARATOR |
|
| CODE_CASE_UPPER |
Non-initial word letter case option Expected value is a boolean. The default value is FALSE. |
| CODE_CASE_CAPITALIZE |
Initial word letter case option |
| CODE_CASE_CAPITALIZE_FIRST_INITIAL |
Capitalize first letter of the first word |
| CODE_CASE_CAPITALIZE_FIRST |
|
| CODE_CASE_CAPITALIZE_FOLLOWING_INITIALS |
Capitalize first letter of other words |
| CODE_CASE_CAPITALIZE_OTHER |
|
| CODE_CASE_CAPITALIZE_INITIALS |
Capitalize first letter of all words |
| CODE_CASE_CAPITALIZE_ALL |
|
| CODE_CASE_CAPITALIZE_WORDS |
|
| CODE_CASE_PRESERVE_CAPITAL_WORDS |
|
| CODE_CASE_WORD_OPTIONS |
|
Methods
Indicates if the given text represents a floating point number
Indicates if the given text represents an integer
No description
No description
Set the first letter case
No description
Transform text to follow theCamelCase style
Transform text to "Something a normal human is happy to read"
Transform text to follow the-kebab-case style
Transform text to follow the MACRO_CASE style
Transform text to follow ThePascalCase style
Transform text to follow the_snake_case style
Transform to to "A Ttile Case"
No description
Transform text to a user defined code style
No description
Details
at line 26
static boolean
isFloat(string $text)
Indicates if the given text represents a floating point number
at line 38
static boolean
isInteger(string $text)
Indicates if the given text represents an integer
at line 54
static array|false
firstOf($haystack, $needles = array(), $firstOnly = false)
at line 86
static string|Hexadecimal
toHexadecimalString(integer|string $value, boolean $upperCase = false)
at line 126
static string
firstLetterCase(string $text, boolean $upper = true)
Set the first letter case
at line 131
static
explodeCodeWords($text, $options = 0)
at line 236
static string
toCamelCase(string $text, $capitalizationOptions = 0)
Transform text to follow theCamelCase style
at line 256
static string
toHumanCase(string $text, $capitalizationOptions = 0)
Transform text to "Something a normal human is happy to read"
at line 274
static string
toKebabCase(string $text)
Transform text to follow the-kebab-case style
at line 290
static string
toMacroCase(string $text)
Transform text to follow the MACRO_CASE style
at line 308
static string
toPascalCase(string $text, $capitalizationOptions = 0)
Transform text to follow ThePascalCase style
at line 329
static string
toSnakeCase($text)
Transform text to follow the_snake_case style
at line 347
static string
toTitleCase(string $text, $capitalizationOptions = 0)
Transform to to "A Ttile Case"
at line 358
static
toTrainCase($text, $capitalizationOptions = 0)
at line 436
static string
toCodeCase(string $text, array $options)
Transform text to a user defined code style