PHP funkce substr()

Dostupnost ve verzích: PHP 4.0

Return part of a string

Parametry

Parametr Datový typ Výchozí hodnota Poznámka
$string string není Zpracovávaný řetězec.
$start int není If start is non-negative, the returned string will start at the start'th position in string, counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth.
$length int null If length is given and is positive, the string returned will contain at most length characters beginning from start (depending on the length of string).

string

|bool the extracted part of string or false on failure.

Další zdroje

Oficiální dokumentace funkce substr

AI konzultace & implementace

Pomohu vám zavést AI do vašeho projektu– od analýzy a návrhu řešení až po nasazení do produkce. Ušetřete čas, zjednodušte procesy a získejte konkurenční výhodu.

Domluvit konzultaci
Konzultant: Jan Barášek
Potřebujete poradit s PHP?

Nabízím trénink vývojářů, konzultace, školení a analýzu návrhových vzorů. Osobně v Praze nebo online.

Napište mi

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.