filtering search results with php
Posted
by
fl3x7
on Stack Overflow
See other posts from Stack Overflow
or by fl3x7
Published on 2011-01-28T20:17:55Z
Indexed on
2011/01/28
23:26 UTC
Read the original article
Hit count: 157
Hello,
Cant really find any useful information on this through Google so hope someone here with some knowledge can help.
I have a set of results which are pulled from a multi dimensional array. Currently the array key is the price of a product whilst the item contains another array which contains all the product details.
key=>Item(name=>test, foo=>bar)
So currently when I list the items I just order by the key, smallest first and it lists the products smallest price first.
However I want to build on this so that when a user sees the results they can choose other ordering options like list all products by a name, certain manufacturer, colour, x ,y ,z etc etc from a drop down box(or something similar)
This is where I need some guidance. Im just not sure how to go about it or best practise or anything. The only way I can think of is to order all the items by the nested array eg by the name, manufacturer etc. but how do I do that in PHP?
Hope you understand what im trying to achieve(if not just ask). Any help on this with ideas, approaches or examples would be great.
Thanks for reading
p.s Im using PHP5
© Stack Overflow or respective owner