PHP If Statement not working

Soldato
Joined
30 Nov 2005
Posts
3,084
Location
London
Having a problem with an IF statement in PHP. It seems to think that the string stored in the variable is less than six when it's not.

When I echo the $something the value is longer than six yet it still seems to think that it's not and dies.

Any ideas?

Code:
if($something < 5){
die(include "toosmall.php");
}
 
Last edited:
Right, I echoed the $something before the IF statement is run and its prints the correct value.

I also echoed AFTER the IF statement is run and no value is printed.

Hmmmmmmmmmmm.......
 
i must say, that's a bizarre way of working. are you not going to end up with a dozen scripts for one form?? :confused: :p

Do you mean if I run this to check each string?

Would there be an easier method?

Edit: Silly me, I remember functions! So how would I create a function for the above that I could use on different variable names?
 
Last edited:
Back
Top Bottom