I have a C# .NET 3.5 application using the ADO.NET Driver for MySQL (Connector/NET). It stores a Guid.NewGuid()
in the MySQL database as a BINARY(16)
.
I have another application using PHP 5.3.4 that needs to be able to read that binary value as a GUID string and encode a GUID string in the same 16-byte binary value.
As an example I want to be able to convert between these two things:
GUID string: E241346C-504F-4BE5-BDF3-1B8274815597
BINARY(16): 65 32 34 31 33 34 36 63 2d 35 30 34 66 2d 34 62
How can I do this in PHP?