I am a great believer in keeping things simple, which I admit does mean my code is sometimes longer and less intuitive than others.
For me this is a simple matter of 4 strings.
1 - Take your first string $one = ‘abcdefghijklmnopqrstuvwxyz’
2 - use substr() to create 2 new strings based on the first string so $two = the end right hand character and $three = the left 25 characters
3 - then add the 2 strings together so $four = $two.$three
4 - set $one = $4 and loop
So basically a loop that runs 26 times, splitting the string in two parts consisting of 25 and 1 character, add them together and do it again
Sorry ! just checked and realised I was doing it the wrong way. I was taking last letter and putting it at the beginning. You wanted to take first letter and put it at the end so I amended the code
Yeah more applicable to his code, I agree. Thing is to be honest, I have always had a personal phobia of arrays, don’t know why, I just fear them, black magic voodoo - I am the same with preg - I need to embrace them I guess and stop avoiding them
Never took it as a criticism my friend - it was a good point and I deliberately avoided the array solution because I don’t understand them. But I am going to take your code as a learning tool because now I have two different solutions to a known problem and I can cross reference and maybe start using arr, arrra, arrra, arrays - There I said it!