The code sample below displays the entries from the bitrix database on the page, but displays them in the order “From the old date to the new one” (field DATE_ACTIVE_FROM ).
How to change the output in the order "From the new date to the old"?
<?if( !empty($arItem["VIEW"]) ):?> <ul class="short-news"> <?foreach ($arItem["VIEW"] as $key => $value):?> <li> <? $date = explode(" ", $value['DATE_ACTIVE_FROM']); ?> <? $date[0] = str_replace('/','.',$date[0]); ?> <span class="sn-date"><?=$date[0]?></span> <noindex><a target="_blank" class="exp-news-name" rel="nofollow" href="<?=$value['PROPERTY_LINK_VALUE']?>"><?=$value['NAME']?></a></noindex> <span class="clear"></span> </li> <?endforeach;?> </ul> <?endif;?>