Improve php split/join array and move it to its own plugin