php unique id within a month
<p>I need unique id (as much unique as possible) during a month and during one year. Code must be short. Code is necessary for accounting software as identification number of entry/record.</p>

<p>Aim is to get it unique if company during a month has not more than 10 000 transactions. Also aim is that code must be as short as possible and also php code is as short as possible and uses as little server resources as possible. </p>

<p>Mysql autoincrement can not be used, for example if 10 000 transactions per month, then after some years the number would be very long.</p>

<p>At the moment decided to use such</p>

<pre><code> date("m"). '-' .substr(md5(uniqid(rand(), true)), -20, 4);
</code></pre>

<p>Are any better solution?</p>
