PHP funkce substr()
06. 07. 2020Dostupnost ve verzích: PHP 4.0
Return part of a string
Parametry
Parametr | Datový typ | Výchozí hodnota | Poznámka |
---|---|---|---|
$string | string | The input string. | |
$start | int | 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). |
Návratové hodnoty
string
|bool the extracted part of string or false on failure.
Další zdroje
https://php.net/manual/en/function.substr.php
Jan Barášek Více o autorovi
Autor článku podniká jako fullstack senior developer v Praze. Spravuje 300 různě velkých webových projektů, fungujících dodnes. Během spolupráce nabral hluboké zkušenosti, které na tomto webu předává dál.
Rád vám pomůžu:
Kontakt Konzultace a služby Nabídka spolupráce