For instance, in one case the sentence can have 2 words, and in other case the sentence can have 5 words. I think that I can use explode to get every word in each case (something like here), the problem is that the number of words in each sentence varies. After that initial problem, I need to resemble the sentence but using & instead of blank spaces, e.g.,
input: this is a sentence
output: this & is & a & sentence
I'm new in php, so please bear with me if this question is very simple.
Thanks in advance for any hints!