Hi there,
I have 2 arrays,
############################
where the first array:
$FirstArray[0][0] = '20050809'; //date format
$FirstArray[0][1] = 'Text1';
$FirstArray[0][2] = 'Text2';
$FirstArray[1][0] = '20050801'; //date format
$FirstArray[1][1] = 'Text7';
$FirstArray[1][2] = 'Text8';
############################
and the second array:
$SecondArray[0][0] = '20050805'; //date format
$SecondArray[0][1] = 'Text3';
$SecondArray[0][2] = 'Text4';
$SecondArray[1][0] = '20050810'; //date format
$SecondArray[1][1] = 'Text5';
$SecondArray[1][2] = 'Text6';
############################
How can I merge the 2 arrays and sort them acsending based on the date in [x][0]? so I want the result to be like the following:
############################
$FinalArray[0][0] = '20050801'; //date format
$FinalArray[0][1] = 'Text7';
$FinalArray[0][2] = 'Text8';
$FinalArray[1][0] = '20050805'; //date format
$FinalArray[1][1] = 'Text3';
$FinalArray[1][2] = 'Text4';
$FinalArray[2][0] = '20050809'; //date format
$FinalArray[2][1] = 'Text1';
$FinalArray[2][2] = 'Text2';
$FinalArray[2][0] = '20050810'; //date format
$FinalArray[2][1] = 'Text5';
$FinalArray[2][2] = 'Text6';
############################
Thanks in advance
I have 2 arrays,
############################
where the first array:
$FirstArray[0][0] = '20050809'; //date format
$FirstArray[0][1] = 'Text1';
$FirstArray[0][2] = 'Text2';
$FirstArray[1][0] = '20050801'; //date format
$FirstArray[1][1] = 'Text7';
$FirstArray[1][2] = 'Text8';
############################
and the second array:
$SecondArray[0][0] = '20050805'; //date format
$SecondArray[0][1] = 'Text3';
$SecondArray[0][2] = 'Text4';
$SecondArray[1][0] = '20050810'; //date format
$SecondArray[1][1] = 'Text5';
$SecondArray[1][2] = 'Text6';
############################
How can I merge the 2 arrays and sort them acsending based on the date in [x][0]? so I want the result to be like the following:
############################
$FinalArray[0][0] = '20050801'; //date format
$FinalArray[0][1] = 'Text7';
$FinalArray[0][2] = 'Text8';
$FinalArray[1][0] = '20050805'; //date format
$FinalArray[1][1] = 'Text3';
$FinalArray[1][2] = 'Text4';
$FinalArray[2][0] = '20050809'; //date format
$FinalArray[2][1] = 'Text1';
$FinalArray[2][2] = 'Text2';
$FinalArray[2][0] = '20050810'; //date format
$FinalArray[2][1] = 'Text5';
$FinalArray[2][2] = 'Text6';
############################
Thanks in advance