How to correctly implement PHP generated unique identifiers _php tutorial

Source: Internet
Author: User
What we are going to cover for you today is about

PHP generates a unique identifier code example:

    1. < ?
    2. Generate a unique identifier
    3. SHA1 () function, "Secure Hash Algorithm (SHA1)"
    4. function Create_unique () {
    5. $ Data = $_server[' http_user_agent ']. $_server[' REMOTE_ADDR ']
    6. . Time (). Rand ();
    7. Return SHA1 ($DATA);
    8. Return MD5 (Time (). $data);
    9. return $data;
    10. }
    11. ?>

PHP generates a unique identifier function description and examples

 
  
  
  1. < ?
  2. $ Newhash create_unique();
  3. Echo $newhash;
  4. ?>


http://www.bkjia.com/PHPjc/446019.html www.bkjia.com true http://www.bkjia.com/PHPjc/446019.html techarticle What we're going to cover for you today is an example of a unique identifier code for PHP generation:?//Generate Unique identifier//SHA1 () function, Secure Hash Algorithm (SHA1) Functioncreate_uniq ...

  • 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.