What would be the best way to insert characters after the first occurrence of a word or phrase in a given string?
eg.
$ var = 'A large brown dog jumped over the fence;
Insert "s" after the dog does this: "Big brown dogs jumped over the fence."
Thank:)
source
share