Home › Forums › Front-end Issues › ACF Relationship – Loop, highest selected option › Reply To: ACF Relationship – Loop, highest selected option
the number of bedrooms is the array index, array_search() searches the values which in your case is the number of times it was selected. If you looking for the most times or least times selected then you search the values. If you want to know the highest lowest selected you’d need to search the keys.
$lowest_selected = min(array_keys($bedroom_count))
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.