Well, what you do is the use the pseudo-random numbers generated to produce a string.
One method is to specify an array (or string) of characters that you would accept in the pseudo-random string.
Then, run a loop the required number of times, concatenating a character selected from the array, based on the number generated.
e.g.
//specficy a string of characters
$chars = "abcdefghijklmnopqrstuvwxyz0123456789";
//get the number of characters
$chars_len = strlen($chars);
//seed the Mersenne Twister Pseudo-random number generator
mt_srand((double)microtime() * 1000000);
//this will be the final result;
$result = '';
//loop 20 times, or as desired
for ($i = 0; $i < 20; $i++) {
//generate string (or array) 0 to the last valid index
$randnum = mt_rand(0, $chars_len - 1);
//concatenate with the final result
$result .= $chars{$result};
}