I have a function that adds random dots to a string and stores the altered string in a variable, however, sometimes it adds multiple dots in a row. For example:
te...stin.g
or
t..e.st.in.g
or
te.st.in....g
...and so on.
I was wondering, how can I detect if there are multiple dots in a row, and just make them into one. So for example the first string above would become:
te.stin.g
the second...
t.e.st.in.g
the third...
te.st.in.g
...and so on.
How can I accmplish this with PHP? I have no idea where to start.