Table of Contents
The substr_count()Â function is a built-in function in PHP which is used counts the number of times a substring occurs in a string.
Note:
This function does not count overlapped substrings. The substring is case-sensitive.
Syntax:
string – This parameter is required. It specifies the string to check.
substring – This parameter is required. The substring passed in the parameter is searched is the string and the occurrence count is returned.
start – This parameter is optional. It Specifies where to begin searching in the string.
length – This parameter is optional. It specifies the length of the search.
Example: