note 80080 rejected from language.operators.arithmetic by nlopess

From: Date: Fri, 28 Dec 2007 09:55:19 +0000
Subject: note 80080 rejected from language.operators.arithmetic by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134067@lists.php.net to get a copy of this message
Note Submitter: jim dot jzhang at gmail dot com ---- For the following code, <?php $reportCount = 46; $rowsPerPage = 20; for ($i = 0; $i < $reportCount; $i++) { $n = $i; if(($n % $rowsPerPage) == 0) { $pageNo = $n * $rowsPerPage + 1; echo "<br/> ". $n ." * " .$rowsPerPage." = ".$pageNo; } } The output is 0 * 20 = 1 20 * 20 = 401 40 * 20 = 801 I cannot understand why this happen.

« previous php.notes (#134067) next »