<?php/** * Never produces a unique activation code * @return String */function create_guid ($namespace = null) {static $guid = '; $uid = Uniqid ( "", true); $data = $namespace; $data. = $_server [' Request_time ']; Request the time stamp of the moment $data. = $_server [' http_user_agent ']; Get an interview with what operating system $data. = $_server [' server_addr ']; Serverip$data. = $_server [' Server_port ']; Port number $data. = $_server [' REMOTE_ADDR ']; Remote Ip$data. = $_server [' Remote_port ']; Port Information $hash = Strtoupper (hash (' ripemd128 ', $uid. $guid. MD5 ($DATA))); $guid = ' {'. substr ($hash, 0, 8). '-' . SUBSTR ($hash, 8, 4). '-' . SUBSTR ($hash, 12, 4). '-' . SUBSTR ($hash, 16, 4). '-' . SUBSTR ($hash, 20, 12). '} '; return $guid;} Use echo $key = Create_guid ();
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
PHP generates a unique activation code