i have a code like this
$count=15; // i manually initialising a value that not satisfying by folling condition
$low_limit=0;
$up_limit=10;
$num_pages=0;
(some loop) {
if (($count >= $low_limit) && ($count <= $up_limit))
{
$num_pages=$numpages+1;
echo $num_pages;
}
$low_limit=$up_limit+1;
$up_limit=$up_limit+10;
} // loop ends
my logic was
$count
is a variable // this value can be frequently changed
$low_limit
and $up_limit
are value ranges // 0-10 , 10-20 , 20-30 ,etc
$num_pages
is a variable that return
1 if
$low_limit
= 0 and$up_limit
= 102 if
$low_limit
= 11 and$up_limit
= 203 if
$low_limit
= 21 and$up_limit
= 30 and so on
here the $low_limit
and $up_limit
can be any number (but multiple of 10). it may be upto 50,000.
what will be in some loop
.?
How i construct this program, i searched a lot, but i only find programs which checks a number between a range.
Any help would be greately appreciated.