Mad_T;10998808 wrote:How do I compare the two as numbers.
eg: if $b < $a etc..
Exactly as you've written it there (well, plus some ()'s). PHP is a loosely-typed language, and the necessary type juggling happens automatically when needed (see the manual page: [man]types.type-juggling[/man]).
Mad_T;10998808 wrote:Ideally I'd also like to pad both variables to 4 digits so 800 -> 0800
I'm assuming you mean for display purposes only (e.g. treating them as strings and not numbers)? If so, that sounds like a job for [man]printf/man.