I tried to use rand() to make it my unique id in database. But how to make sure that this random number will not be duplicated?
<?php
$num = '';
for ($i = 0; $i < 9; $i++)
$num .= mt_rand(0, 9);
echo '<input name="counter" value="'.$num.'">';
?>