> You cannot use comparision operaters (<=, >=, >) with strings. 
> When you put quotes around your variable it defines it to 
> php as a string, which translated means that it's words, not
> numbers.  So you could say 

> if ("$total" == "lowprice") {
>   code code code
> }
> 
> but not say ("$total" >= 25) {
>   code code code
> }

In fact you can say that, since php is type less and does implicit
casting, it will evaluate it as integer comparisment in both cases.
 
> Also, you have defined your intergers as strings. 

Which is not a good practice, but it will work,
since php will keep track on the casting.

> You're much better off with comparision operators using only
> intergers  rather than comparing two strings that should be intergers.

I agree with you.




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to