function test(int $a): string
{
return 1 + $a;
}
$path . time() . $name[0] . '.png'
function checkExist($string)
{
$db_check = db_query("select count(*) from short where short_key = '$string'")->fetch();
/// бла бла return true или false
/// if (array_shift($db_check)) { что это вообще? =)
}
function stringCheck($string)
{
if (checkExist($string)) {
stringCheck(genegateId());
} else {
return $string;
}
}
$db_check = db_query("select count(*) from short where short_key = '$key'")->fetchColumn();
if ($db_check) {
exit('Повтор ID'); //на самом деле надо перегенерить
}