Is it possible to implode multiple array values?
From what I have researched so far, all the examples include imploding multi dimensional arrays (using array_map) or imploding all values from an array using implode(',', $array);
However, I would like to know if there is a way to implode array values from an array:
array([0] (
array [0] ([0] A, [1] B, [2] C, [3] H)
array [1] ([0] A, [1] D, [2] G, [3] H, [4] L)
array [2] ([0] D, [1] Z, [2] J, [3] K, [4] O, [5] X)
)
array([1] (
array [2] ([0] F, [1] Y, [2] W, [3] H, [4] L)
)
array([2] (
array [0] ([0] O, [1] T, [2] C, [4] O, [5] X)
array [1] ([0] U, [1] E, [2] E, [3] D)
))
Note: the strings in each array can be repeated several times and it has no bearing on the outcome.
Desired Outcome
to arrive at a result that looks like this:
$result = array(
array [0] (A_C, B_H, C)
array [1] (A_G, D_H, G_L)
etc...
The expected results should allow me to test, IF the value cannot be combined (because it is at the end of the array), then display the single value
Being a beginner, my first resort was to try out implode implode($array[0], '_', $array[2]);
but I found out it does not work as 2 parameters are allowed