Hi,
i am trying to sort a multidimensional array, but i am experiencing some problems.
Here is what i want to do:
My script reads the title and the "meta description" of all ".htm" files in a preset directory and then creates an array, which looks like:
$array[0][0] = meta description1 of file1
$array[0][1] = page title of file1
$array[1][0] = meta description2 of file1
$array[1][1] = page title of file1
$array[2][0] = meta description2 of file1
$array[2][1] = page title of file1
$array[3][0] = meta description1 of file2
$array[3][1] = page title of file2
$array[4][0] = meta description2 of file2
$array[4][1] = page title of file2
$array[5][0] = meta description1 of file3
$array[5][1] = page title of file3
.
.
.
So, if i do a array_multisort($array) i get it sorted like:
title of file1 - meta description1 of file1
title of file1 - meta description2 of file1
title of file1 - meta description3 of file1
title of file2 - meta description1 of file2
title of file2 - meta description2 of file2
.
.
.
so the "title"s get sorted alphabetically, but i need it the meta descriptions sorted alphabetically and the "title"s can be left unsorted, or like the meta descriptions are sorted now: alphabetically to each "title".
I tried to change the multidimensional array, but it keeps sorting it alphabetically to the "title"s.
Any idea?
Regards,
Duncan