I am looking for an algorithm in PHP to make output of all possibilities with dot. produces we can put do in any place of word but repeated two dots after each other is now allowed. for example Shaghayegh output like below:
S.haghayegh
Sh.aghayegh
Shag.hayegh
Sh.agha.ye.gh
output that is not allowed:
s..haghayegh (repeat dots right after each other)
.shaghayegh (put dots at first of word)
shaghayegh. (put dots at end of word)