I have two arrays and I want the first one to be sorted by the value in my second array. My problem is that the elements of my first array is a string, my second array is only integers. The array that I want to achieve must have the lowest time to the highest time
First array:
[
'<tr data-time="1437513780"><td>test01</td>',
'<tr data-time="1435779420"><td>test02</td>',
'<tr data-time="1438316400"><td>test03</td>'
]
Second array:
[
1435779420,
1437513780,
1438316400
]
The array I want to achieve :
[
'<tr data-time="1435779420"><td>test02</td>',
'<tr data-time="1437513780"><td>test01</td>',
'<tr data-time="1438316400"><td>test03</td>'
]
EDIT: What I need is a new array based on the values of the second array but the same way it looks in the first array!