h1 Новости h1 php foreach data as elem echo div class news echo h3 ele

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<h1>Новости</h1>
<?php
foreach ($data as $elem)
{
echo '<div class="news">';
echo '<h3>'.$elem->title.'</h3>';
echo '<p>'.$elem->content.'</p>';
echo '<p class="date">'.$elem->date.'</p>';
echo '</div>';
}
?>