- substr: documentation ( source)
- uniqid: documentation ( source)
- print_r: documentation ( source)
- strtoupper: documentation ( source)
- rand: documentation ( source)
- md5: documentation ( source)
<?php
function generate_GUID() {
$uuid = md5(uniqid(rand(), true));
print_r($uuid);exit;
$guid = substr($uuid,0,8)."-".
substr($uuid,8,4)."-".
substr($uuid,12,4)."-".
substr($uuid,16,4)."-".
substr($uuid,20,12);
return $guid;
}
echo strtoupper(generate_GUID());