Filter/Sort through a value with three associated values (MONTH, DAY, and YEAR)
I'm trying to filter through some images.
Each image has 3 sets of values that I need to sort through collectively, MONTH, DAY, YEAR.
I'm trying to figure out how to choose a specific a YEAR, DAY, and/or MONTH and then filter my list of images accordingly.
This isn't homework. I don't study CS. I'm writing this in PHP, but your answer probably doesn't need php code for me to know what to do.
I don't know that much about sorting algorithms. Perhaps someone could also point me to an interesting introduction to this topic as well?
Just to make things more clear:
I'd like to be able to go through it backwards or forwards, for example, if someone only selects one of the filters/values, like DAY, then the images displayed will be all those associated with that开发者_开发问答 DAY, regardless of MONTH or YEAR.
I have everything already written. It is a website with drop down menus, and when a user selects one item from the YEAR, DAY, or MONTH menus, I will repopulate the others accordingly.
Thanks for the help.
Use PHP's usort
with a custom comparison callback function.
精彩评论