Case insensitive: to replace anything beginning with the first instance of "dog" and the last instance of "cat" with the word "animal."
Note: sometimes there are characters between dog and cat (example: dogxxxxcat) and sometimes there are no characters between dog and cat (example: lfjljfdjldogcatlsfjsjsljslj)
Examples:
$string = 'My dogcat is cool'; (becomes My animal is cool)
$string = 'Wonderfuldogcatandappleappleapplecatcatcat'; (becomes Wonderfulanimal)
$string = 'dog cat'; (becomes animal)
$string = 'dogcatdogcatdogcatdogcatdogcatdog'; (becomes animaldog)
Lastly, I want to apologize to you all for this idiotically simple question. I have been studying everything on the net for the past 2 and a half days, and cannot find the answer... I am thinking I have one of those "mental blocks" where I probably "saw" the answer, but just didn't "see" the answer.
So, thank you to whoever answers, and thank you for not getting mad at me.