How to produce a short unique id in php?
<p>In order to produce a unique Id I suppose I must use the uniqid function in php.<br>
But uniqid produces a 13 digits long HEXA number, by default.  </p>

<pre><code>4f66835b507db
</code></pre>

<p>I would like to reduce this number to 7 digits long NUMERIC number but I want to conserve the unicity. Is it possible ?  </p>

<pre><code>4974012  
</code></pre>

<p>This number will be used as User Id. The authentication will be done with thid Id and a password.</p>

<p>Some people say uniqid is not unique ! Is it a bad choice ?</p>
