RE: [PHP] incrementing string value
| From: | Ford, Mike [LSS] | Date: | Mon, 28 Jul 2003 09:38:30 +0000 |
| Subject: | RE: [PHP] incrementing string value | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157147@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Curt Zirzow [mailto:curt@zirzow.dyndns.org]
> Sent: 26 July 2003 01:14
>
> * Thus wrote Curt Zirzow (curt@zirzow.dyndns.org):
> > * Thus wrote Jeremy (jeremy@elijahgeneration.com):
> > > let me make sure I understand...
> > >
> > > $var = 'a';
> > > $var++
> > > print($var);
> > >
> > > would print "b" to the screen?
> >
> > um.. ignore my post ealier.. yes it does print 'b'
>
> I forgot to mention, be sure to check how far you are in your loop
> cause last time i checked:
>
> ...
> var z[];
> var {[];
>
> will produce a javascript error.
That shouldn't be a consideration, since:
<?php
$x = 'z';
$x++;
?>
will set $x to 'aa' (IIRC).
This is also why
for ($x='a'; $x<='z'; $x++)
doesn't do what you might expect.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211