- ⌂ string_util
- Static Methods
string_util::to_identifier()
Return a string as a valid identifier by:
- Removing all HTML entities and character values.
- Converting " & " to " and ".
- Normalizing accent characters.
- Removing any characters that are not upper- or lower-case letters or numbers.
Identifiers can be used as an cObject Key.
Prototype
string to_identifier(string $string)
Parameters
- string - Text string that will be processed and turned into an identifier.
Return
A string containing only upper- and lower-case letters and numbers.
Example
// $identifier will be 'ThisisanExample'
$title = 'This is an Example';
$identifier = \io_comand_util\string_util::to_identifier($title);