note 109582 modified in function.mssql-guid-string by danbrown

From: Date: Fri, 10 Aug 2012 16:26:00 +0000
Subject: note 109582 modified in function.mssql-guid-string by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-190031@lists.php.net to get a copy of this message
Hi guys. Here is a simple implementation to fill the gap with FreeTDS:

<?php
$guid = unpack("h16a/H16b", $guid);
$guid = strtoupper(strrev(substr($guid["a"],0,8)).strrev(substr($guid["a"],8,4)).strrev(substr($guid["a"],12,4)).$guid["b"]);
$guid = substr($guid, 0, 8) . "-" . substr($guid, 8, 4) . "-" . substr($guid, 12, 4) . "-" . substr($guid, 16, 4) . "-" . substr($guid, 20);
?>

Cheers. --was-- Hi guys. Here is a simple implementation to fill the gap with FreeTDS: $guid = unpack("h16a/H16b", $guid); $guid = strtoupper(strrev(substr($guid["a"],0,8)).strrev(substr($guid["a"],8,4)).strrev(substr($guid["a"],12,4)).$guid["b"]); $guid = substr($guid, 0, 8) . "-" . substr($guid, 8, 4) . "-" . substr($guid, 12, 4) . "-" . substr($guid, 16, 4) . "-" . substr($guid, 20); Cheers. http://php.net/manual/en/function.mssql-guid-string.php

« previous php.notes (#190031) next »