1) { $excep = include('pluralexcep.php'); // Load exception list if(array_key_exists($word, $excep)) { $word = $excep[$word]; } else if(!in_array(substr($word,-2,1), $vowel) && substr($word,-1)==='y') // Rule [1.0] { $word = rtrim($word,'y').'ies'; } else if(substr($word,-1)==='f' || substr($word,-2,2)==='fe') // Rule [2.0] { $word = (substr($word,-1)==='e') ? substr($word, 0, -2) : substr($word, 0, -1); $word = $word.'ves'; } else if((!in_array(substr($word,-2,1), $vowel) && substr($word,-1)==='o') // Rule [3.1] || in_array(substr($word,-2,2), ['ch','sh','ss']) || in_array(substr($word,-1), ['s','x','z'])) // Rule [3.2] { $word = $word.'es'; } else { // Rule [4.2], covering [4.1] $word = $word.'s'; } } else if ($count < 0){ return false; // No negate in real world object existance !!?? } if(!empty($return_count)) $word = $count.' '.$word; return $word; } return false; }