From December 2005

Make a Unique ID in PHP

This may be useless. It's a snippet of code.

Here's the result:

WN1498232578

...And the Source Code:

<?php
// Just a small sample of making a unique id in PHP
// http://www.php.net/manual/en/function.chr.php
// http://www.php.net/manual/en/function.rand.php
// http://www.php.net/manual/en/function.time.php
// http://www.php.net/manual/en/function.uniqid.php

	$prefix = 'W'; // a universal prefix prefix 
	$my_random_id = $prefix;
	$my_random_id .= chr(rand(65,90));
	$my_random_id .= time();
	$my_random_id .= uniqid($prefix);
	print $my_random_id;
?>
blog comments powered by Disqus