creating a unique id
Posted: Fri Apr 24, 2009 12:59 pm
i need to create a unique id with php and i dont wanna use uniqid() could i possibly convert it to base 10 and still get the same exclusive results?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
base_convert(uniqid(), 16, 10)Code: Select all
<?php
header('Content-Type: text/plain');
for ($i = 0; $i < 50; $i++)
{
$uid = uniqid();
echo $uid . ' : ' . base_convert($uid, 16, 10) . "\n";
}
?>