hi,
Hast Du schonmal etwas von Schleifen gehört? M.E. wäre while ziemlich sinnvoll.
http://de2.php.net/manual/de/control-structures.while.php
dabei aber bitte unbedingt noch eine andere abbruchbedingung einbauen (z.b. x erfolglose versuche).
wenn es nämlich durch "zufall" mal vorkommt, dass keine "neue" zahl erzeugt wird, hängt man sonst in einer endlosschleife fest.
gruß,
wahsaga
--
"Look, that's why there's rules, understand? So that you _think_ before you break 'em."
"Look, that's why there's rules, understand? So that you _think_ before you break 'em."