Commit e8181632 authored by Matthieu FAURE's avatar Matthieu FAURE

refactor: give meaningful names to function and variable + remove useless PHP tags

parent 859d6441
<?php
/*
Template Name: Test
*/
get_header(); ?>
<?php
get_header();
$fichier = fopen('grille.csv', 'r');
$ligne = fgetcsv($fichier, 1024, ";");
......@@ -24,7 +17,6 @@ function isWordIn($word, $list)
return true;
}
}
return false;
}
......@@ -40,22 +32,19 @@ function deleteAccents($variable)
return $variable;
}
function createSecondSelectList($liste)
function createSizeSelectList($liste)
{
//fonction qui crée la liste de classes qui sert pour le 2e select
$listeTempo = [];
$resultList = [];
for ($a = 0; $a < count($liste); $a++) {
$mot = str_replace(" ", "_", $liste[$a][0]);
$mot = deleteAccents($mot);
if (!isWordIn($mot, $listeTempo)) {
$listeTempo[] = ($mot);
if (!isWordIn($mot, $resultList)) {
$resultList[] = ($mot);
}
}
return $listeTempo;
return $resultList;
}
......@@ -67,7 +56,7 @@ while ($ligne) {
fclose($fichier);
$secondSelectList = createSecondSelectList($listeFinale);
$sizeSelectList = createSizeSelectList($listeFinale);
?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment