Re: When is "z" != "z" ?
| From: | Ryan A | Date: | Sun, 04 Jun 2006 22:20:44 +0000 |
| Subject: | Re: When is "z" != "z" ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237382@lists.php.net to get a copy of this message | ||
<clip>
> There will always be edge cases. Being able to
increment
> strings is pretty handy when you need to create
sequences for unique file
> and directory names.
>
> For example, this also works:
>
> $filename = "file1";
> $filename++;
> echo $filename;
>
> You would get "file2" from this. Think about the
> amount of code you would need to write in C to make
that work?
>
> Then change $filename to "fileA" and increment it.
> And you get "fileB".
> When we get to "fileZ" we don't want to go off
> into unprintable
> character land, we want to try to stick with the
> pattern.
</clip>
Hmmm, didnt know about the $filename++; thingy, I used
to do things the hard (C) way.
Learnt something new...thanks!
Cheers,
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com