Generating a unique ID in PHP

前端 未结 3 1897
无人及你
无人及你 2021-02-05 13:33

I\'m trying to generate a unique ID in php in order to store user-uploaded content on a FS without conflicts. I\'m using php, and at the moment this little snippet is responsib

3条回答
  •  渐次进展
    2021-02-05 14:00

    string uniqid ([ string $prefix [, bool $more_entropy ]] )
    

    Gets a prefixed unique identifier based on the current time in microseconds.

    USAGE: $id = uniqid(rand(), true);
    

提交回复
热议问题