Skip to content
Advertisement

Sort big array based by matching small array in php

I have an array-

JavaScript

I want to resort this array dynamically to

JavaScript

I have tried to find out the subarray based on which I know exactly from where to re-sort

JavaScript

This has given me the output –

JavaScript

Now I want to use this sub-array as the identifier to resort to the main array. Basically this sub-array will be the resort starting point for the big array.

Advertisement

Answer

Here is the solve array

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement