There is such a json , in the usual way it is convenient to use it to display one news, but in descending order, it is convenient to use it to display all news (first new ones, below the old ones).
How can this be done?
$json = json_decode($output); $json_main = $json->News; if ($_GET['action'] == 'news') { $content .= '<div class="News">'; foreach ($json_main as $item) { $content.= '<div class="New"><div class="NewsTitle"><a href="/new/'.$item->ID.'" onclick="getNewsOne('.$item->ID.');">'.$item->Title.'</a></div><div class="NewsContent">'.$item->ShortContent.'</div></div>'; } $content .= '</div>'; Show($content,'Новости'); }