Gerador de string aleatória PHP

Estou tentando criar uma string aleatória no PHP e não recebo absolutamente nenhuma saída com isso:

<?php
function RandomString()
{
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $randstring = '';
    for ($i = 0; $i < 10; $i++) {
        $randstring = $characters[rand(0, strlen($characters))];
    }
    return $randstring;
}
RandomString();
echo $randstring;

O que estou fazendo errado?

questionAnswers(30)

yourAnswerToTheQuestion