Mailinglisten-Archive |
Cyrill Schumacher schrieb:
>
> $rand=array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
> 'Q','R','S','T','U','V','W','X','Y','Z');
>
> function rand_array_value($array) {
> srand((double)microtime()*1000000);
> return $array[rand(0,count($array)-1)];
> }
>
> kürzer geht es nun wirklich nicht ! oder ????
Steno-Version:
function rand_array_value() {
srand((double)microtime()*1000000);
return chr(rand(ORD('A'),ORD('Z')));
}
Ich hab' aber gehört, es funktioniert manchmal nicht unter Windows.
mfg oK
php::bar PHP Wiki - Listenarchive