nombre de mots

This commit is contained in:
Adrien MALINGREY 2025-04-28 00:38:15 +02:00
parent e04b6f0b91
commit b3ad38815f

View File

@ -13,9 +13,13 @@ if (($lecteur = fopen("dico.csv", "r")) !== FALSE) {
if (substr($ligne[0], 0, 1) != "#" && count($ligne) >= 3) { if (substr($ligne[0], 0, 1) != "#" && count($ligne) >= 3) {
[$mot, $definition, $auteur] = $ligne; [$mot, $definition, $auteur] = $ligne;
if ($auteur) { if ($auteur) {
$dico[$mot] = "$definition <small><em>$auteur</em></small>"; $dico[strtoupper($mot)] = "$definition <small><em>$auteur</em></small>";
} else { } else {
$dico[$mot] = $definition; $dico[strtoupper($mot)] = $definition;
}
$nb_espaces = substr_count($mot, ' ');
if ($nb_espaces > 0) {
$dico[$mot] .= " <small>(" . ($nb_espaces + 1) . " mots)</small>";
} }
} }
} }