I don't know if there is a simple solution but just in case...
I want to get the first highest *even* number for a given odd number.
I.e.: if $odd = 15 I want to get $even = 16 .
Any idea?
Thanks!
Tomas
[SOLVED] Change odd number to first highest even number?
Moderator: General Moderators
-
tomfra
- Forum Contributor
- Posts: 126
- Joined: Wed Jun 23, 2004 12:56 pm
- Location: Prague, Czech Republic
[SOLVED] Change odd number to first highest even number?
Last edited by tomfra on Thu Sep 09, 2004 7:04 am, edited 1 time in total.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Code: Select all
if (fmod($odd,2)) $even=$odd+1;http://www.php.net/manual/en/ref.math.php