suntažnieks Posted February 3, 2013 Report Share Posted February 3, 2013 Problēma: reizēm rezultātu parāda kā vienādu atšķirīgiem skaitļiem. Kods: <?php $rand1 = rand(1,5); $rand2 = rand(1,5); print "num1 = $rand1 </br>"; print "num2 = $rand2 </br> </br>"; if ($rand1 > $rand2) {print "greater number = $rand1 </br>";} elseif ($rand1 < rand2) {print "greater number = $rand2 </br>";} else {print "numbers are equal: $rand1 = $rand2 </br>";} ?> rezultāts: Kur varētu būt problēma? Link to comment Share on other sites More sharing options...
suntažnieks Posted February 3, 2013 Author Report Share Posted February 3, 2013 (edited) nevermind, biju piemirsis pielikt $ simbolu pirms "rand2" :) Edited February 3, 2013 by suntažnieks Link to comment Share on other sites More sharing options...
Recommended Posts