$auteur"; break; } $mot = strtoupper($mot); $longueur = strlen($mot); if (!isset($dico[$longueur])) $dico[$longueur] = []; if (!isset($dico[$longueur][$mot])) $dico[$longueur][$mot] = []; if (strlen($definition)) $dico[$longueur][$mot][] = $definition; } fclose($lecteur); } function mots_espaces($longueur) { global $dico; foreach ($dico[$longueur] as $mot => $definition) { yield [$mot]; } for ($i = MIN_LETTRES_MOT_1; $longueur - $i - 1 >= MIN_LETTRES_MOT_2; $i++) { foreach ($dico[$i] as $mot => $definition) { foreach (mots_espaces($longueur - $i - 1) as $mots) { if (!in_array($mot, $mots)) { yield [$mot, ...$mots]; yield [...$mots, $mot]; } } } } }