poprawna-forma-liczby-mnogiej-php

Jak wyświetlać poprawną formę rzeczowników liczby mnogiej w PHP

POPRAWIONE ROZWIĄZANIE: $plural_matches = [ 'osoba’ => [’1′], 'osób’ => [’*0′, '*1′, '*5′, '*6′, '*7′, '*8′, '*9′], 'osoby’ => [’*2′, '*3′, '*4′] ]; $number = (string) rand(0, 999999); $last_digit = substr($number, -1); // wyjątek dla '1′ $look_for = strlen($number) == $last_digit && $last_digit == 1 ? '1′ : „*$last_digit”; function findVariant($plural_matches, $look_for) { foreach ($plural_matches… Kontynuuj czytanie „Jak wyświetlać poprawną formę rzeczowników liczby mnogiej w PHP”