I have an array of objects I'm using to create a menu, and each object has the properties id, video_id and chapter_id.
I'd like to make a for each loop such as
foreach($menu_objects as $object WHERE $object->chapter == $variable)
Is there a way of doing this?