Hello,
I think you're asking for a PHP solution.
Here's one :
<?php
$randchar = "0123456789"; // all the character that can be contained in your string ( feel free to add letter )
srand((double)microtime()*1000000); // initialize random function
for($i=0; $i<16; $i++) // 16 char string
$pass .= $randchar[rand()%strlen $randchar)];
?>
your generated string is in $pass