note 70980 deleted from ref.math by colder

From: Date: Tue, 07 Nov 2006 14:53:03 +0000
Subject: note 70980 deleted from ref.math by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-119474@lists.php.net to get a copy of this message
Note Submitter: Adlez Reason: bad code ---- Easy way to find if a number is prime or not. <?php $ammt = 15; for ( $counter = 1; $counter <= $ammt; $counter += 1) { $number = $ammt/$counter; if ($counter != 1 && $counter != $ammt){ if (is_int($number)){ $composite = 1; } } } if ($composite){ print "$ammt is a composite number."; }else{ print "$ammt is a prime number."; } ?>

« previous php.notes (#119474) next »