The articles now have a rubrique (section) and a texte (text). But on the front page, Madame Lou only wants the standfirst, those few words that make you want to read on. And she likes her sections in capitals, “like in the real newspapers”.
Your mission
- Before each article's title, print its section in capitals in a
<p class="rubrique">: “VILLAGE FAIR”, “WEATHER”… - After the author, print the standfirst in a
<p class="chapo">(chapois French for standfirst). - The standfirst is the first 80 characters of the text, followed by “…”, when the text is longer than 80 characters. A shorter text is shown in full, without “…”.
Reminder
PHP comes with hundreds of string functions. The ones starting with mb_ count in characters: without them, strlen('é') is 2, because “é” takes up two bytes in UTF-8. The gazette is full of such characters: the “fête” in Gaston's article, the “€” of the price, the “…” you are about to add. Make mb_ a habit.
As with the mayor's cat, some texts are in double quotes: "Odette is expecting your pots…". That's because of the apostrophe in “Gaston's nettle soup”: inside single quotes, it would end the string too early.