Is there a function that allows me to find the position of a word in a string? By position I don't mean which number char it is in a string. I know there are plenty of functions that do this already such as strpos() and strstr() and others. What I'm looking for is a function that will return the number a word is in string relative to the number of words.
So for example, if I'm searching for "string" in the text "This is a string" the result would be 4.
Note: I am not interested in splitting up the string into an array. I need a function that allows me to enter the string as a string, not as an array. Therefore the answer here Find the exact word position in string is not what I'm looking for.