VB6 to PHP ... temptation while it is easy ... do you know VB6 or PHP ?
Andre - seeing as it's you...:)
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.
Code seems to work fine as well, some kudos fur ya':)
which means 99 would not be included at all. Was this intentional?
No, dropped a few brain cells here, should have been equal or less to 99 etc.
Ok, how about that bottle of Castle?
Oh yah, I'll have two on you tonight, that ok.;) You know you're beer!!!, but then again, S.A. Breweries is producing half the worlds beer anyway.;)
by AndreRet: n/a
> 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! :)