I have two php arrays. And you have another sort question for each of these arrays:
1) First contains a list of domains:
values[0] = "absd.com";
values[1] = "bfhgj.org";
values[2] = "sdfgh.net";
values[3] = "sdff.com";
values[4] = "jkuyh.ca";
I need to sort this array alphabetically by DOMAIN value, in other words, by value after ".", So the sorted domain will look like this:
values[0] = "jkuyh.ca";
values[1] = "absd.com";
values[2] = "sdff.com";
values[3] = "sdfgh.net";
values[4] = "bfhgj.org";
2) I also have a second array that contains "double" domain values:
values[0] = "lkjhg.org.au";
values[1] = "bfhgj.co.uk";
values[2] = "sdfgh.org.uk";
I need to sort this array alphabetically using the value DOUBLE DOMAIN, in other words, the value after the first instance of '.' in the domain, so the sorted domain will look like this:
values[1] = "bfhgj.co.uk";
values[0] = "lkjhg.org.au";
values[2] = "sdfgh.org.uk";
How do I solve this problem? The approach is sort()sorted based on the first letter only ...