I use something like this for generating random "captcha" strings:
$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
$randChar = $chars[rand(0, strelen($chars) - 1)];
It's not necessarily better/worse than the array-based options, but I found it useful because it was easy to manipulate. For instance, if I want to increase the possibility of a the selected character being a number, and I want to avoid certain characters that could be confusing (o or 0, l or 1, i or j, u or v):
$chars = 'abcdefghkmnpqrstwxyz2233445566778899';