Not all news is created equal: the pumpkin festival is the event of the year. Madame Lou has marked it with 'une' => true (une means front page). As for the article about the mayor's cat, Gaston has taken his name off it: he'd rather not fall out with the mayor.
Your mission
- In the loop, when an article's
unekey istrue, open it with<article class="article une">and add the banner<p class="bandeau">Top story</p>before its title. - Otherwise, keep
<article class="article">, with no banner. - When the author is an empty string, print
<p class="auteur">By the newsroom</p>instead.
Reminder
if runs a block only if its condition is true, and else takes over otherwise. A boolean is either true or false. To compare, === checks that two values are equal and of the same type, unlike the more lenient ==.
When an if/else only picks between two values, PHP has a short form, the ternary operator: condition ? valueIfTrue : valueIfFalse. For example, $classe = $article['une'] ? 'article une' : 'article';. Stick with the if as soon as there's more than one thing to do, as here with the banner.