Mailinglisten-Archive |
> Christian Heimerl schrieb:
>> Hallo,
>>
>> ja das wäre toll. Wie Sebastian schon geschrieben hatte, ist shuffle()
>> oder array_rand()
>> deine Funktion.
>>
>> Ich empfehle array_rand() siehe PHP-Doku
>>
>> |<?php
>> srand ((float) microtime() * 10000000);
>> $input = array ("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
>> $rand_keys = array_rand ($input, 2);
>> print $input[$rand_keys[0]]."\n";
>> print $input[$rand_keys[1]]."\n";
>> ?> |
>
> mhm ... er mag mich vielleicht nicht ... :-(
>
>
> --
> Sebastian
Sag doch sowas nicht;) So ist das natürl. wesentlich einfacher:)
Hatte ich etwas missverstanden!
Danke Leute!
php::bar PHP Wiki - Listenarchive