I am trying to find out where the position of a string occurs in another string.
I can use strpos but this returns the character position, and I am looking for the word count. For example:
$haystack = 'The letters PHP stand for PHP: Hypertext Preprocessor. PHP originally stood for. Personal Home Page Tools.';
$needle = 'PHP: Hypertext Preprocessor';
magic_function($haystack, $needle); // This should return 6