I have a multi dimensional array which I want to spread its data based on a shared scenario added below, I have tried a couple of way but it didn't return what I expect, I don't share my source code as it won't help and wasn't suitable to share.
Note: While generating the new sets of array year and order number of alphabet (A, B, C, D or ...) should be considered, .
This is my array:
array(
array(["AF2021A"], ["AF2021B"], ["AF2020C"]),
array(["IR2022A","IR2021A"], ["IR2022B","IR2021B"], ["IR2022C","IR2021C"], ["IR2022D","IR2021D","IR2020D"]
));
I expect below results from this array:
First dimension should return this:
AF2020C - AF2021A
AF2020C - AF2021B
AF2021B - AF2021A
Second dimension should return this:
IR2020D - IR2021A
IR2020D - IR2021B
IR2020D - IR2021C
IR2020D - IR2021D
IR2020D - IR2022A
IR2020D - IR2022B
IR2020D - IR2022C
IR2020D - IR2022D
IR2021A - IR2021B
IR2021A - IR2021C
IR2021A - IR2021D
IR2021A - IR2022A
IR2021A - IR2022B
IR2021A - IR2022C
IR2021A - IR2022D
IR2021B - IR2021C
IR2021B - IR2021D
IR2021B - IR2022A
IR2021B - IR2022B
IR2021B - IR2022C
IR2021B - IR2022D
IR2021C - IR2021D
IR2021C - IR2022A
IR2021C - IR2022B
IR2021C - IR2022C
IR2021C - IR2022D
IR2021D - IR2022A
IR2021D - IR2022B
IR2021D - IR2022C
IR2021D - IR2022D
IR2022A - IR2022B
IR2022A - IR2022C
IR2022A - IR2022D
IR2022B - IR2022C
IR2022B - IR2022D
IR2022C - IR2022D