I want to replace each instance of a given string with a number.
ex:
<?php
$string = "Hello Foo Text Apple"
preg_replace($pattern, $pattern.$i++, $string);
//output
Hello0 Foo1 Text2 Apple3
?>
the $pattern is a regex query but in this case I have used plain text