MISC - heikijapan/php-book2 GitHub Wiki
All other SMALL thins that one should know!!!
pre-increment and post-increment
++$indexthis increments first and then outputs the value; if initial value is 0, then it outputs 1$index++it uses or echoes the initial value first and then increments it by 1$index +=1this is similar to pre-increment
Firstly, I had now idea that pre-increment actually existed. When pre-and post-increment used in a foreach loop then they will alter the index of iteration, but this $index + 1; will not change iteration index. Therefore you should be careful when using these in your projects.