PHP Class pocketmine\utils\TextFormat

Mostra file Open project: ClearSkyTeam/ClearSky Class Usage Examples

Public Methods

Method Description
clean ( string $string, boolean $removeFormat = true ) : mixed Cleans the string from Minecraft codes and ANSI Escape Codes
toANSI ( $string ) : string Returns a string with colorized ANSI Escape codes
toHTML ( string | array $string ) : string Returns an HTML-formatted string with colors/markup
toJSON ( string | array $string ) : string Returns an JSON-formatted string with colors/markup
tokenize ( string $string ) : array Splits the string by Format tokens

Method Details

clean() public static method

Cleans the string from Minecraft codes and ANSI Escape Codes
public static clean ( string $string, boolean $removeFormat = true ) : mixed
$string string
$removeFormat boolean
return mixed

toANSI() public static method

Returns a string with colorized ANSI Escape codes
public static toANSI ( $string ) : string
$string
return string

toHTML() public static method

Returns an HTML-formatted string with colors/markup
public static toHTML ( string | array $string ) : string
$string string | array
return string

toJSON() public static method

Returns an JSON-formatted string with colors/markup
public static toJSON ( string | array $string ) : string
$string string | array
return string

tokenize() public static method

Splits the string by Format tokens
public static tokenize ( string $string ) : array
$string string
return array