uuid()
uuid() : string
Generate a (hopefully) unique, time-based UUID
Returns
string —UUID
Text processing static class Mostly just helpers
truncate(string $str, string $length = 100, string $ending = '...', boolean $exact = false, boolean $considerHtml = true) : string
Trim a string, optionally preserving the sentences.
| string | $str | |
| string | $length | Trim length |
| string | $ending | String end |
| boolean | $exact | Make resulting string the exact length |
| boolean | $considerHtml | Consider the HTML output when trimming |
generateToken(integer $length = 10) : string
Generate a relatively random token of a given length.
THIS IS NOT CRYPTOGRAPHICALY SECURE and don't use it for that purpose. You're going to have a bad time.
Based on (https://stackoverflow.com/a/1516430) but improved for randomness and security.
| integer | $length |