Here i decided this code above could be confusing, here is an
example, I want to replace "cool" in this sentance with the
number of times it was found.
$sentance = "i am a cool kid, cool is my middle name, cool is also my last name";
i want the sentance after the eregi_replace to be "i am a cool1 kid, cool2 is my middle name, cool3 is also my last name". I want to add the number of times it has been found so far to the end of cool.