I want to sort an array based on a sub array value, that part is fairly simple, but there is an additional requirement.
I also have a known set of values, in which case I want to sort by those instead
In this case the values I am sorting by are IP addresses.
For example, if the address is 1.1.1.5, I want that address to be the first value in the list, and if its 1.1.7.3, I want that to be the second value on the list, and so on.
Then once I am out of known addresses, I want the rest to simply be sorted normally.
The starting order of the array is completely random If possible I also want to append something to the front of the known IPs
How I sort it without the prioritization:
uasort($array, function func($a, $b) {
return strcmp($a[4], $b[4]);
});