<?php

function recommend_reviewers($submission_keywords)
{
    $db = \App\Core\Database::getInstance();

    $rows = $db->query("SELECT id, expertise FROM users WHERE role_id=5")->fetchAll();

    $recommended = [];

    foreach ($rows as $r) {
        similar_text($submission_keywords, $r['expertise'], $percent);
        if ($percent > 30) {
            $recommended[] = $r['id'];
        }
    }

    return $recommended;
}
