[eluser]vtatds[/eluser]
In my view, I'm doing a foreach loop:
foreach($results as $result){
if ($result == 'noresults'){echo 'There are no results';}
else{echo $result->activity_name;}
in the else, i want to check if the next element in the array has the same value as the current. I need to write a div prior to it if it has the same value (to hide it for an accordian), and not write a div if it does not have the same value.
i feel like i'm missing something simple here. I thought next() would do it but i get a php error if i do next($result->activity_name) stating that php is expecting a string.
any thoughts? need more explanation to make it clearer?