[Solved] Parse comma separated string, split array into chunks, then transpose
So long as the number of rows is known, it only takes: a regex to split the string on comma-spaces which immediately follow a one-or-more digits or a word starting with an uppercase letter, a call of array_chunk() and array_map() (with a null callback and data spreading) to “transpose” the data. Code: (Demo) $string = … Read more