📅  最后修改于: 2022-03-11 14:54:36.806000             🧑  作者: Mango
$name = 'foo';
$first_name = $name;
$i = 0;
do {
//Check in the database here
$exists = exists_in_database($name);
if($exists) {
$i++;
$name = $first_name . $i;
}
}while($exists);
//save $name