- mssql_guid_string() returns strings for all sort of arbitrary input data, regardless of length and content (though not all are necessarily valid GUID string represenations, since length varies)

- is_string() on GUID variables is true

therefore a mssql_is_guid() function would be a nice thing.

Unfortunately, there is very little that makes a GUID a GUID. Aside from the length of 16 bytes there are only 2 indicators (and even those only for microsoft system call compatibly generated GUIDs):

the upper 4 bits of character 7 encode the version of the GUID, and are either 0001 (v1) , 0011 v3), or 0100 (v4)(ASCII characters 10 - 1f, 30 ('0') to 3f ('?') or 40 ('@') to 4f ('O'))depending on the encoding version of the GUID.

GUIDs generated by mssql server 2005s "NEWID()" statement are version 4, indicating that the GUID is completely randomly generated

the upper 1 to 3 bits of character 8 which encode the GUID variant. In the case of GUIDs generated by MsSQL server 2005 the variant always seems to be 'Standard' which is indicated by bit sequence 10.((non)ASCII characters 81 to BF)

so as long as no custom hacked or 3rd party inserted GUIDs are used this should be working: