PHP funkce substr_count()
06. 07. 2020Dostupnost ve verzích: PHP 4.0
Count the number of substring occurrences
Parametry
Parametr | Datový typ | Výchozí hodnota | Poznámka |
---|---|---|---|
$haystack | string | The string to search in | |
$needle | string | The substring to search for | |
$offset | int | null, | The offset where to start counting |
$length | int | null | The maximum length after the specified offset to search for the substring. It outputs a warning if the offset plus the length is greater than the haystack length. |
Návratové hodnoty
int
This functions returns an integer.
Další zdroje
https://php.net/manual/en/function.substr-count.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