LoginSignup
1
1

More than 5 years have passed since last update.

PHPでかんたんに一意のIDを発行する方法

Posted at

uniqid()という関数を使う

string uniqid ([ string $prefix [, bool $more_entropy ]] )
マイクロ秒単位の現在時刻にもとづいた、接頭辞つきの一意な ID を取得します。

uniqid

現在時刻にもとづき13桁の文字列が発行される。

uniqid();
//5539e2d75cc2b
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1