Returning unique values of a multi-dimensional array with CodeIgniter PHP

Posted by Michael Bradley on Stack Overflow See other posts from Stack Overflow or by Michael Bradley
Published on 2009-07-18T14:22:40Z Indexed on 2010/05/05 3:08 UTC
Read the original article Hit count: 335

Filed under:
|
|

Hi - I'm developing a property rentals website. The search results page will contain a list of property results. It is my intention to redefine the results, say by town, country, property type etc.

So let's say for example the user searches 'France'. All of the relative properties will be returned and displayed in a list.

However, I also need to reuse this array, to display only unique town names from the search results array. e.g. Montpellier, Lyon, Rennes, Nice etc. The idea is when use user click on 'Nice', only the 'Nice' properties would return. I would also like to display how many properties are in that town.

The closest example as to what I want to achieve. http://www.miaandmaggie.com/dog-collars-leashes.html

Any ideas how I can use my search array to display the unique towns of the search?

Many thanks! M

© Stack Overflow or respective owner

Related posts about codeigniter

Related posts about php