Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ilya Hoilik ilyahoilik

🏠
Working from home
Block or report user

Report or block ilyahoilik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d1da047dbc94d2f9ab627b3ddbded3ce
<?php
function get_word_form( $count, $word_forms = [ 'предмет', 'предмета', 'предметов' ] ) {
$count = preg_replace( '/[^\d]/', '', $count );
$n100 = $count % 100;
$n10 = $count % 10;
if ( ( $n100 > 10 ) && ( $n100 < 20 ) ) {
return $word_forms[2];
} elseif ( $n10 == 1 ) {
You can’t perform that action at this time.