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.
This function does not count overlapped substrings. The substring is case-sensitive.
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.