To create a flat list out of a list of lists, you can use the itertools.chain function from the itertools module in the Python standard library.
You can use array_walk_recursive() function in PHP to flatten a multidimensional array.