I'm having difficulties understanding the below code. What does this mean?
if((($weight-0.5)%2)>0 && (($weight-0.5)%2)/2 < 0.25) {
$price=$initial+(($weight-0.5)/2)*$lessthan15kg;
}
I'm having difficulties understanding the below code. What does this mean?
if((($weight-0.5)%2)>0 && (($weight-0.5)%2)/2 < 0.25) {
$price=$initial+(($weight-0.5)/2)*$lessthan15kg;
}
This in your if statment
mean ($weight-0.5)%2)>0
--This mean if the remainder
is greater than zero
($weight-0.5)%2)/2 < 0.25
-- This means if you devide remainder
by Two
and its less than 0.25
.
in the middle you got &&
in your if statement
. Thats mean both the condition has to be true(IN other words both condition should be met). than your code will get executed