NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - mb_substr

Trieda

Koreň \ Bez triedy

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ázovDátový typPredvolená hodnotaPopis
$strstring

The string.

$startint

The starting position. If the starting position is negative, the returned substring is counted from the end of the string.

$lengthint NULL

The length of the substring.

$encodingstring mb_internal_encoding()

As usual, the functions with the mb_ prefix can be encoded.

Mávratovej hodnoty

Vracia: string

The substring.

Príklady

<?php
echo mb_substr("This is a simple string.", 7, 4);

Súvisiace manuály

      Aktivity