---
title: "danog\\TelegramEntities\\EntityTools: Telegram UTF-16 styled text entity tools."
description: ""

---
# `danog\TelegramEntities\EntityTools`
[Back to index](../../index.md)

> Author: Daniil Gentili <daniil@daniil.it>  
  

Telegram UTF-16 styled text entity tools.  




## Method list:
* [`mbStrlen(string $text): int`](#mbStrlen)
* [`mbSubstr(string $text, integer $offset, (null|int) $length = NULL): string`](#mbSubstr)
* [`mbStrSplit(string $text, integer<0, max> $length): list<string>`](#mbStrSplit)
* [`mbSubstrReplace(string $string, string $replace, integer $offset, (null|int) $length = NULL): string`](#mbSubstrReplace)
* [`htmlEscape(string $what): string`](#htmlEscape)
* [`markdownEscape(string $what): string`](#markdownEscape)
* [`markdownCodeblockEscape(string $what): string`](#markdownCodeblockEscape)
* [`markdownCodeEscape(string $what): string`](#markdownCodeEscape)
* [`markdownUrlEscape(string $what): string`](#markdownUrlEscape)

## Methods:
### <a name="mbStrlen"></a> `mbStrlen(string $text): int`

Get length of string in UTF-16 code points.


Parameters:

* `$text`: `string` Text  



### <a name="mbSubstr"></a> `mbSubstr(string $text, integer $offset, (null|int) $length = NULL): string`

Telegram UTF-16 multibyte substring.


Parameters:

* `$text`: `string` Text to substring  
* `$offset`: `integer` Offset  
* `$length`: `(null|int)` Length  



### <a name="mbStrSplit"></a> `mbStrSplit(string $text, integer<0, max> $length): list<string>`

Telegram UTF-16 multibyte split.


Parameters:

* `$text`: `string` Text  
* `$length`: `integer<0, max>` Length  


#### See also: 
* `max`




### <a name="mbSubstrReplace"></a> `mbSubstrReplace(string $string, string $replace, integer $offset, (null|int) $length = NULL): string`

Telegram UTF-16 multibyte subreplace.


Parameters:

* `$string`: `string` Text  
* `$replace`: `string` Replacement  
* `$offset`: `integer` Offset  
* `$length`: `(null|int)` Length  


Return value: The result string is returned. If string is an array then array is returned.


### <a name="htmlEscape"></a> `htmlEscape(string $what): string`

Escape string for this library's HTML entity converter.


Parameters:

* `$what`: `string` String to escape  



### <a name="markdownEscape"></a> `markdownEscape(string $what): string`

Escape string for markdown.


Parameters:

* `$what`: `string` String to escape  



### <a name="markdownCodeblockEscape"></a> `markdownCodeblockEscape(string $what): string`

Escape string for markdown codeblock.


Parameters:

* `$what`: `string` String to escape  



### <a name="markdownCodeEscape"></a> `markdownCodeEscape(string $what): string`

Escape string for markdown code section.


Parameters:

* `$what`: `string` String to escape  



### <a name="markdownUrlEscape"></a> `markdownUrlEscape(string $what): string`

Escape string for URL.


Parameters:

* `$what`: `string` String to escape  



---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
