|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
express 'between a range of numbers' in an 'if statement'
how would i express 'between a range of numbers' in a if statement. for example if i wanted to say between 100 and 1000, how would that be done????
Code:
function purchase_add_select_tel($add_select_tel_licence,$a dd_select_tel) {
if ($add_select_tel < 99) {
return 0;
} else if ($add_select_tel 100 - 1000) {
$price = ($add_select_tel_licence/1000) * $add_select_tel;
return $price;
} else if ($add_select_tel > 1000) {
$2ndprice = ($add_select_tel_licence/2000) * $add_select_tel;
return $2ndprice;
}
}
|
|
#2
|
|||
|
|||
|
To test if var $x is between 100 - 1000 (inclusive) use the follow -
PHP Code:
To do this exclusively remove the '=' signs from the above. Hope this helps, -KM- |
|
#3
|
|||
|
|||
|
thanks kode_monkey!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > express 'between a range of numbers' in an 'if statement' |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|