Hello everyone
I have a scandir function which returns, as it should, an array of directories and files. The directories are, for example,
tid1, tid4, tid17 etc
But the 1, 4 and 17 are ids of people (the names are in a mysql db). Eg. id 1 is John Williams, id4 is Cathy Barnes and id 17 is Willy Franklin. I need the directories returned in alphabetical name order of the people, rather than in the order id1, tid4, tid17. So it should return in the order Cathy Barnes, Willy Franklin then John Williams.
So I was thinking that after the directories were in the array, I'd have to somehow do a name change, but I'm not sure how.
Does php have anything that might help me here? Or is there some obvious way I'm not aware of to solve this one?
Thanks in advance
I have a scandir function which returns, as it should, an array of directories and files. The directories are, for example,
tid1, tid4, tid17 etc
But the 1, 4 and 17 are ids of people (the names are in a mysql db). Eg. id 1 is John Williams, id4 is Cathy Barnes and id 17 is Willy Franklin. I need the directories returned in alphabetical name order of the people, rather than in the order id1, tid4, tid17. So it should return in the order Cathy Barnes, Willy Franklin then John Williams.
So I was thinking that after the directories were in the array, I'd have to somehow do a name change, but I'm not sure how.
Does php have anything that might help me here? Or is there some obvious way I'm not aware of to solve this one?
Thanks in advance
Comment