Jump to content

Select DISTINCT values of a fields in a pages selector


abmcr
 Share

Recommended Posts

I need retrieve a list DISTINCT of values of a field (city) in a selector.

now i have create a foreach Cycle for get the pages 

$arr=array();
$p=$pages->find(...);
foreach($p as $el){
  $arr[]=$el->city;
}
//now unique...

But there is a most efficient way?

thank in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...