From b3ad38815f085d240e7382ab0fac447b1d026d08 Mon Sep 17 00:00:00 2001 From: adrien Date: Mon, 28 Apr 2025 00:38:15 +0200 Subject: [PATCH] nombre de mots --- dico.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dico.php b/dico.php index 34084a2..e55a600 100644 --- a/dico.php +++ b/dico.php @@ -13,9 +13,13 @@ if (($lecteur = fopen("dico.csv", "r")) !== FALSE) { if (substr($ligne[0], 0, 1) != "#" && count($ligne) >= 3) { [$mot, $definition, $auteur] = $ligne; if ($auteur) { - $dico[$mot] = "$definition $auteur"; + $dico[strtoupper($mot)] = "$definition $auteur"; } else { - $dico[$mot] = $definition; + $dico[strtoupper($mot)] = $definition; + } + $nb_espaces = substr_count($mot, ' '); + if ($nb_espaces > 0) { + $dico[$mot] .= " (" . ($nb_espaces + 1) . " mots)"; } } }