Skip To Main Content | Home | Sitemap | Contact
 

How To Generate A GUID Using PHP


PHP has the "com_create_guid" function. Since that is a COM function one can assume it leverages internal Window's functionality to obtain a GUID.  Obviously this is useful only on IIS. Refresh the page to obtain a new GUID. A User contributed pseudo GUID generator for non-Windows servers can be found here.

What is a GUID? Excerpt from Wikipedia: "A globally unique identifier or GUID is a special type of identifier used in software applications to provide a reference number which is unique in any context (hence, "globally"), for example, in defining the internal reference for a type of access point in a software application, or for creating unique keys in a database. While each generated GUID is not guaranteed to be unique, the total number of unique keys (2128 or 3.4×1038) is so large that the probability of the same number being generated twice is extremely small."

GUIDs are useful in creating anti-CSRF tokens for web applications. Generate A GUID Using ASP.


GUID: {AE575EB0-E11B-4D01-8CC6-17B6BB4099F0}


Simple Use: 
$guid = com_create_guid();
echo $guid;



Latest Visitors: United States's flagUnited States's flagRussian Federation's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagItaly's flagIndia's flagIndia's flagUnited States's flagFrance's flagGermany's flagIsrael's flagItaly's flagUnited States's flagChina's flagChina's flagUnited States's flagIndia's flagUnited States's flagUnited States's flagChina's flagUnited States's flag


This Weeks Most Popular Pages Newest Pages
PrintBookmark
Comment