What we want to introduce to you in detail today is the code example of
PHP generating unique identifier:
- < ?
- //Generate unique identifier
- //sha1() function, "Secure Hash Algorithm (SHA1)"
- function create_unique() {
- $data = $_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR']
- .time () . rand();
- return sha1($data);
- //return md5(time().$data) ;
- //return $data;
- }
- ?>
PHP generate unique identifier function description and examples
<ol class="dp-xml">
<li class="alt"><span><span class="tag"><</span><span> ? </span></span></li><li><span>$</span><span class="attribute">newhash</span><span> = </span><span class="attribute-value">create_unique</span><span>(); </span></li><li class="alt"><span>echo $newhash; </span></li><li><span class="tag">?></span><span> </span></span></li>
<li class="alt"><span> </span></li>
</ol>
http://www.bkjia.com/PHPjc/446019.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446019.htmlTechArticleWhat we want to introduce to you in detail today is the code example for generating unique identifiers in PHP: ? //Generate unique identifiers Symbol //sha1() function, secure hash algorithm (SHA1) functioncreate_uniq...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn