- substr: documentation ( source)
- microtime: documentation ( source)
- explode: documentation ( source)
- dechex: documentation ( source)
- str_pad: documentation ( source)
- rand: documentation ( source)
<?php
$t = explode(' ', microtime());
$r = substr($t[1], 3) . rand(111, 999) . substr($t[0], 2, 6);
echo dechex($r);
$number = 4;
$hexString = dechex($number);
$result = str_pad($hexString,6,"0",STR_PAD_LEFT);
echo($result);