Convert PHP array splitting to an external plugin