The shortest random and unique IDphp function in history

Source: Internet
Author: User
Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn the random and unique ID php function with the shortest digits. this can be used for the superconnections we receive on our daily mobile phones, for example, XXXXXX. CLICK: http://xxxx.com/user.php/m/o/ I /n.bcuf1bbb.
The php function that generates the shortest random and unique ID. It can be used for text message superconnections received on our daily mobile phones. For example, for details about XXXXXX, click http://xxxx.com/user.php/m/o/ I /n.bcuf1b. Bcuf1b // Author: copper peas
// QQ: 309581329
// Email: bestphper@126.com
// Http://gongwen.sinaapp.com
Function getRandOnlyId (){
// The New Time cut definition is based on the timestamp.
$ Endtime = 1356019200; // 2012-12-21 Timestamp
$ Curtime = time (); // current Timestamp
$ Newtime = $ curtime-$ endtime; // new Timestamp
$ Rand = rand (); // two random
$ All = $ rand. $ newtime;
$ Onlyid = base_convert ($ all, 10, 36); // the unique ID that converts 10 to 36.
Return $ onlyid;
}
// Obtain the random unique id
Echo getRandOnlyId ();
?>

AD: truly free, domain name + VM + enterprise mailbox = 0 RMB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.