Hi @avishay28
If you use var_dump($fields);
, you will see that each field object has a “menu_order” value. You can use array_multisort() on this value to sort it like sorting a repeater field. This page should give you more idea about it: http://www.advancedcustomfields.com/resources/how-to-sorting-a-repeater-field/.
I hope this helps.