こんにちは、9 桁の一意のアカウント番号を生成する必要があります。ここに私の疑似コードがあります:
function generateAccNo()
generate an account number between 100,000,000 and 999,999,999
if the account number already exists in the DB
call generateAccNo() /* recursive call */
else
return new accout number
end if
end function
関数はうまく機能しているようですが、再帰呼び出しが少し心配です。
これによりメモリ リークが発生しますか (Apache での PHP 5)?
これは、この問題に取り組むための受け入れ可能な方法ですか?
ご意見ありがとうございます。