Here is a function that will generate the UUID or global id
function generateUUID() {
$proc="";
$result="";
$command="uuidgen";
if ($proc = popen("($command)2>&1","r")) {
while (!feof($proc)) $result .= fgets($proc, 1000);
pclose($proc);
return trim($result);
}
}