note 119391 added to function.mssql-guid-string
| From: | darylblake at gmail dot com | Date: | Thu, 26 May 2016 21:32:04 +0000 |
| Subject: | note 119391 added to function.mssql-guid-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205591@lists.php.net to get a copy of this message | ||
Since this was removed in PHP7. You can achieve the same output with the following code.
function convertBinToMSSQLGuid($binguid)
{
$unpacked = unpack('Va/v2b/n2c/Nd', $binguid);
return sprintf('%08X-%04X-%04X-%04X-%04X%08X', $unpacked['a'],
$unpacked['b1'], $unpacked['b2'], $unpacked['c1'],
$unpacked['c2'], $unpacked['d']);
}
Enjoy.
----
Server IP: 72.52.91.14
Probable Submitter: 2401:7000:0:9:2d91:2502:1cfe:7533
----
Manual Page -- http://php.net/manual/en/function.mssql-guid-string.php
Edit -- https://master.php.net/note/edit/119391
Del: integrated -- https://master.php.net/note/delete/119391/integrated
Del: useless -- https://master.php.net/note/delete/119391/useless
Del: bad code -- https://master.php.net/note/delete/119391/bad+code
Del: spam -- https://master.php.net/note/delete/119391/spam
Del: non-english -- https://master.php.net/note/delete/119391/non-english
Del: in docs -- https://master.php.net/note/delete/119391/in+docs
Del: other reasons-- https://master.php.net/note/delete/119391
Reject -- https://master.php.net/note/reject/119391
Search -- https://master.php.net/manage/user-notes.php