Text
class Text
text helpers
Constants
LOWER_CASE |
|
UPPER_CASE |
|
FIRST_LETTER_UPPER |
|
Methods
Replace umlauts chars
Clean Text
Pad a string to a certain length with another string (both side)
Pad left a string to a certain length with another string
Pad right a string to a certain length with another string
Mask text
Upper case first letter for Utf8
Slice text
Tokenize text split to words
Transform word ( removes all not a-z chars )
Remove special chars and numbers from text
Convert to title (pascal) case
Replace all code {{ var }} in text with var value
Render multiple text items
Ceate random token
Create random text
Create randowm string
Details
at line 27
static string
replaceChars(string $text)
Replace umlauts chars
at line 59
static string
cleanText(string|null $text)
Clean Text
at line 73
static string
pad(string $input, int $length, string $char = ' ', bool $htmlSafe = true)
Pad a string to a certain length with another string (both side)
at line 89
static string
padLeft(string $input, int $length, string $char = ' ', bool $htmlSafe = true)
Pad left a string to a certain length with another string
at line 105
static string
padRight(string $input, int $length, string $char = ' ', bool $htmlSafe = true)
Pad right a string to a certain length with another string
at line 120
static string
mask(string $text, int $len = 5, string $maskChar = '*')
Mask text
at line 131
static string
ucFirstUtf(string $text)
Upper case first letter for Utf8
at line 143
static string
sliceText(string $text, int $maxLength = 30)
Slice text
at line 161
static array
tokenize(string|array $text, mixed ...$options)
Tokenize text split to words
at line 197
static string
transformWord(string $word, mixed ...$options)
Transform word ( removes all not a-z chars )
at line 229
static string
removeSpecialChars(string $text, bool $removeNumbers = false)
Remove special chars and numbers from text
at line 240
static string
convertToTitleCase(string $text)
Convert to title (pascal) case
at line 258
static string
render(string $text, array $vars = [])
Replace all code {{ var }} in text with var value
at line 275
static array
renderMultiple(array $items, array $vars = [])
Render multiple text items
at line 292
static string
createToken(int $length = 22)
Ceate random token
at line 311
static string
random(int $length = 10, string|null $keyspace = null)
Create random text
at line 326
static string
randomString(int $length = 10)
Create randowm string