case ($xAmount >= 0 && $xAmount < 100):
$xValue = 5;
case ($xAmount >= 100 && $xAmount <= 199):
$xValue = 10;
$xValue = 0; //if not between 0 and 199!
I may be wrong, but your code showed <99 and then 100+, which means 99 would not be included at all. Was this intentional? I've changed it to 0-99,100-199. Again, your second case would not include 199 nor 200.
Ok, example use:
$int = 78;
$reserve = GetReserve($int);
Not tested. Range testing with switch in php is a pain. I usually test it agianst 'true'. If somebody has a better was to do range testing in switch, please let me know.
> but then again, S.A. Breweries is producing half the worlds beer anyway.
Now you're talking. If you come over to Cardiff for an international I'll buy you a pint of Brains S.A. (known locally as Skull Attack). I have to warn you it's an acquired taste. One that I kept on trying to acquire for 20 years. I'm a glutton for punishment, or perhaps just a glutton! :)