I have a multidimensional array that stores people.
Array (
id93294 => (array (
Name => \"Tom Anderson\",
Birthday => \
Excellent question.
This pseudo-code comes from the definition of the problem you gave and is intended to be the callback function given to uasort
. I cannot fill in the details because you've omitted the code you're using; hopefully this leads you on the right track.
function compare(p1, p2):
if birthdays of p1 and p2 are not the same
compare by birthday
else
compare by hometown
If someone could verify that this is a valid comparison function for a sort algorithm in the comments, I would be grateful.