Javascript function to PHP

Can anyone please convert this javascript function in PHP so that it produces the same output?

curid = (new Date()).getTime().toString(16).toUpperCase() +
Math.round( Math.random()*1000000000 ).toString(16).toUpperCase();

Output will be like : 12B4DFF632616E81E71

Thanks

Actually, I didn’t realise Date’s getTime() method returned the number of milliseconds since the epoch.

Here’s an amended snippet which should work on 32bit systems too.


<?php
$curid = vsprintf(
  '&#37;X%X%X',
  array_merge(
    explode(
      '.',
      microtime(true)
    ),
    array(
      rand(1, 1000000000)
    )
  )
);
?>


<?php
$curid = sprintf(
    '&#37;X%X',
    time(),
    rand(1, 1000000000)
);
?>