What syntax I should use to assign rate to user, if there would be 100 of levels. For aim to avoid hundred lines of code?
function showRank($practice) {
$ranks = array( "boy",
"student",
"master");
$rank = $ranks[0];
if ( $practice >= 10 and $practice < 20) {$rank = $ranks[1];}
else if ($practice >= 20 and $practice < 30) {$rank = $ranks[2];}
else if ($practice >= 30 and $practice < 40) {$rank = $ranks[3];}
echo $rank;
}