[thelist] PHP and My coding ignorance

AJ McKee aj.mckee at nmtbmedia.com
Thu Aug 7 20:58:18 CDT 2003


As a last resort I said I'd mail the list so sorry for the blatant I need help post. I am having a wee php problem if anyone has any suggestions that
would be really funky

Okay a user submits a number. If that number is 7 or greater I have to
call function y. However if that number is a multiple of 7 (say 21) the
its got to call function x. But the best bit is if the number is say
greater that a multiple (Say 25) I will have to call function x and
function z and add their results together. I have tried the above code
but maybe I am just dim and don't know maths all that well :) Any help
welcomed. I've posted some code I was messing around with to see if I
could get it to work. But no it did not :(

Anyone got any ideas?

Thanks in advance
AJ

$number1 = "7"; 
$number2 = "14"; 
if($number1 % $number2 == 0) { 
do_it(); 
} 
else { 
dont_do_it(); 
} 
?> 

<?php 
if($number1 / $number2 = (int)($number1 / $number2) { 
do_it(); 
} 
else { 
dont_do_it(); 
}



More information about the thelist mailing list