Re: something funny

From: Date: Wed, 29 Nov 2000 07:55:59 +0000
Subject: Re: something funny
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27666@lists.php.net to get a copy of this message
I has to do with adding (++) to a string and then checking the value as if it was numeric. The following code does what you wanted, $con = "z"; $con++; for ($j="a";$j!=$con;$j++){ echo $j."-"; } apart from changing the string before hand to use as a comparison I do not know why it does it exactly. Good one. Jay ----- Original Message ----- From: "Slavko Dervisevic" <slavkod@EUnet.yu> To: <php-general@lists.php.net> Sent: Tuesday, November 28, 2000 1:54 PM Subject: [PHP] something funny > for ($j="a";$j<="z";$j++){ > echo $j."-"; > } > > is supposed to produce string a-b-c-...-z- > but it produces a-b-..-z-aa-ab-...-yz > what is wrong? > > ===================== > Slavko Dervisevic > Agencija INSIDE > http://www.unovomsadu.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 (#27666) next »