PHP - mb_substr
Trieda
Metóda - mb_substr
(PHP 4 >= 4.0.6, PHP 5, PHP 7)
The mb_substr() function returns a substring from the starting
position with the specific number of characters.
Procedurálne
- function mb_substr (string $str, int $start, int $length = NULL, string $encoding = mb_internal_encoding()) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $str | string | The string. | |
| $start | int | The starting position. If the starting position is negative, the returned substring is counted from the end of the string. | |
| $length | int | NULL | The length of the substring. |
| $encoding | string | mb_internal_encoding() | As usual, the functions with the |
Mávratovej hodnoty
Vracia: string
The substring.
Príklady
<?php
echo mb_substr("This is a simple string.", 7, 4);
Súvisiace manuály
- function mb_internal_encoding (string $encoding = mb_internal_encoding()) : mixed
