[PHP] sorting array in predefined order - uksort

2002-05-24 Thread olinux
I am trying to sort array by key to a defined order - I thought uksort would be best option. Here's what i have come up with from the manual example - however it doesn't work at all. I want to sort this array by $region Array looks like this: $articles[$region][$article_id][$column_name] //

Re: [PHP] sorting array in predefined order - uksort

2002-05-24 Thread Miguel Cruz
Your comparison function doesn't compare anything. You should look at $a and $b and return an answer indicating which one comes first. If you want $a to come before $b, return -1. If they're the same, return 0. If you want $a to come after $b in the sorted list, return 1. miguel On Fri, 24