AW: [PHP] int and strings

From: Date: Thu, 12 Oct 2000 14:48:54 +0000
Subject: AW: [PHP] int and strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19815@lists.php.net to get a copy of this message
PHP does this automatically. When you use the compare operator < with a number (in your example 13), PHP will interpret $age as a number. -----Ursprüngliche Nachricht----- Von: bryan brown [mailto:donmon_98@yahoo.com] Gesendet: Donnerstag, 12. Oktober 2000 16:44 An: php Betreff: [PHP] int and strings Hi. I know that when forms get submitted, all the fields are strings. Suppose I have an age field and I want to check to see if somebody is over 13, I have this: if(is_int($age)){ if($age <= 13){ include('age_error.html'); } } else{ $ageflag = 1; include('userform2.php3'); } Now, do I need to covert $age to int first or does PHP automatically do this. Thanks. __________________________________________________ Do You Yahoo!? Get Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#19815) next »