note 4682 deleted from language.operators by sniper
| From: | sniper@php.net | Date: | Mon, 13 Oct 2003 00:02:42 +0000 |
| Subject: | note 4682 deleted from language.operators by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58349@lists.php.net to get a copy of this message | ||
Note Submitter: stanis@sibfair.nsk.su
----
In case you are just beginning to code in PHP and this is your first experience in programming, the
Modulus (%) is a great way to code photo albums based on a table (it returns the remainder of
integer divided by integer). The modulus helps to wrap data to next row based on the result of
'$currentrow(from db)' % 'number of columns in database'. The only thing to look
out for is that 1 % 4 is 1, 2 % 4 is 2, etc. and not zero or some other number, like you might think
at first. Hope this will help some newbie programmers like myself.