Re: [PHP] counting with leading zeros

2007-10-01 Thread Martin Alterisio
// glob returns an ordered list (rtfm: man glob) // relies on the use of the operator ++ to generate string sequences. function lastFileInSequence($path, $prefix, $first, $suffix) { return array_pop(glob($path . / . $prefix . str_repeat('?', strlen($first)) . $suffix)); } function

Re: [PHP] counting with leading zeros

2007-09-30 Thread Robert Cummings
On Sat, 2007-09-29 at 23:47 -0400, brian wrote: It's not so much that i disrespect Rob. It's just that i felt i had to call him out for being a dickhead by taking my statement out of context. Ok, so I'm a dickhead. What does that make you? A vagina? Name calling really is the lowest form of

Re: [PHP] counting with leading zeros

2007-09-30 Thread Jeffery Fernandez
gee you guys behave like kids. don't you all have other things to do than whinge, swear and blame each other on the list? Take it elsewhere and sort it out. This is bad for the PHP community in general. It doesn't reflect what the community is about. my 2c. On Sunday 30 September 2007 13:47,

Re: [PHP] counting with leading zeros

2007-09-30 Thread tedd
At 11:47 PM -0400 9/29/07, brian wrote: You and i have had our run-ins on this list on more than one occasion. Until now, i've chosen to take your crap in stride. brian I haven't noticed any run-ins. I don't care if you've been the biggest prick on the net -- if you ask a question and it's

Re: [PHP] counting with leading zeros

2007-09-29 Thread brian
tedd wrote: At 8:30 PM -0400 9/27/07, brian wrote: I wasn't bitching! And i *thought* that my numerous attempts at explaining such would have been enough. Obviously not, but wtf can you do with people who seem to want only to stir up shit? It sure sounded like you were bitching. Gee,

Re: [PHP] counting with leading zeros

2007-09-28 Thread tedd
At 8:30 PM -0400 9/27/07, brian wrote: I wasn't bitching! And i *thought* that my numerous attempts at explaining such would have been enough. Obviously not, but wtf can you do with people who seem to want only to stir up shit? It sure sounded like you were bitching. And, your off-list fuck

RE: [PHP] counting with leading zeros

2007-09-28 Thread Dan Parry
: tedd [mailto:[EMAIL PROTECTED] Sent: 28 September 2007 17:20 To: brian; php-general@lists.php.net Subject: Re: [PHP] counting with leading zeros At 8:30 PM -0400 9/27/07, brian wrote: I wasn't bitching! And i *thought* that my numerous attempts at explaining such would have been enough

Re: [PHP] counting with leading zeros

2007-09-27 Thread Robert Cummings
On Wed, 2007-09-26 at 21:56 -0700, Jim Lucas wrote: Now, if you plan to delete any images in the list, this will not work. But if you don't expect to delete any images in the list and always want the ($total_images + 1), then follow along. ?php function getNextImage($path, $prefix) {

Re: [PHP] counting with leading zeros

2007-09-27 Thread tedd
Robert Cummings wrote: Suit yourself. But better programmer's don't just wave their hands in the air and hope for the best. Ah crap -- there's another technique I have to cross off my list. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com --

Re: [PHP] counting with leading zeros

2007-09-27 Thread tedd
At 3:58 PM -0400 9/26/07, brian wrote: Well, this is almost precisely the same thing i have, save for using POSIX character classes, str_pad instead of sprintf(), and incrementing elsewhere. What i was really wondering is if there was a *much simpler* way to do this, not just re-arranging

Re: [PHP] counting with leading zeros

2007-09-27 Thread tedd
At 10:39 PM -0400 9/26/07, brian wrote: Now you're obviously just trying to be a dickhead. While someone is, it's not Rob. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] counting with leading zeros

2007-09-27 Thread brian
tedd wrote: At 3:58 PM -0400 9/26/07, brian wrote: Well, this is almost precisely the same thing i have, save for using POSIX character classes, str_pad instead of sprintf(), and incrementing elsewhere. What i was really wondering is if there was a *much simpler* way to do this, not just

Re: [PHP] counting with leading zeros

2007-09-26 Thread Robert Cummings
On Wed, 2007-09-26 at 15:11 -0400, brian wrote: I have a directory that contains many images (no, not pr0n, unfortunately) and i'm working on an admin script for adding to it. I've got something that works alright but i'm wondering if there's a Better Way. Each image is named like:

Re: [PHP] counting with leading zeros

2007-09-26 Thread brian
Robert Cummings wrote: On Wed, 2007-09-26 at 15:11 -0400, brian wrote: I have a directory that contains many images (no, not pr0n, unfortunately) and i'm working on an admin script for adding to it. I've got something that works alright but i'm wondering if there's a Better Way. Each image

Re: [PHP] counting with leading zeros

2007-09-26 Thread Robert Cummings
On Wed, 2007-09-26 at 15:58 -0400, brian wrote: Robert Cummings wrote: On Wed, 2007-09-26 at 15:11 -0400, brian wrote: I have a directory that contains many images (no, not pr0n, unfortunately) and i'm working on an admin script for adding to it. I've got something that works alright

Re: [PHP] counting with leading zeros

2007-09-26 Thread brian
Robert Cummings wrote: On Wed, 2007-09-26 at 15:58 -0400, brian wrote: Robert Cummings wrote: On Wed, 2007-09-26 at 15:11 -0400, brian wrote: I have a directory that contains many images (no, not pr0n, unfortunately) and i'm working on an admin script for adding to it. I've got

Re: [PHP] counting with leading zeros

2007-09-26 Thread Robert Cummings
On Wed, 2007-09-26 at 19:10 -0400, brian wrote: Robert Cummings wrote: Well, this is almost precisely the same thing i have, save for using POSIX character classes, str_pad instead of sprintf(), and incrementing elsewhere. What i was really wondering is if there was a *much simpler*

Re: [PHP] counting with leading zeros

2007-09-26 Thread brian
Robert Cummings wrote: On Wed, 2007-09-26 at 19:10 -0400, brian wrote: If my response to that gave you the impression i was complaining, i assure you that i wasn't. I was simply suggesting that i was wondering if there was a *much* simpler way to do this, ie. without using several functions to

Re: [PHP] counting with leading zeros

2007-09-26 Thread Robert Cummings
On Wed, 2007-09-26 at 22:39 -0400, brian wrote: Robert Cummings wrote: On Wed, 2007-09-26 at 19:10 -0400, brian wrote: If my response to that gave you the impression i was complaining, i assure you that i wasn't. I was simply suggesting that i was wondering if there was a *much* simpler

Re: [PHP] counting with leading zeros

2007-09-26 Thread brian
Robert Cummings wrote: When you use sort() the default behaviour is a lexical sort. This is why the 100th index breaks your system. I'm not trying to be a dickhead, just pointing out the flaw in your logic. You may be well aware that in counting 100 comes after 99, but it would seem you are not

Re: [PHP] counting with leading zeros

2007-09-26 Thread Robert Cummings
On Thu, 2007-09-27 at 00:23 -0400, brian wrote: Robert Cummings wrote: When you use sort() the default behaviour is a lexical sort. This is why the 100th index breaks your system. I'm not trying to be a dickhead, just pointing out the flaw in your logic. You may be well aware that in

Re: [PHP] counting with leading zeros

2007-09-26 Thread Jim Lucas
brian wrote: I have a directory that contains many images (no, not pr0n, unfortunately) and i'm working on an admin script for adding to it. I've got something that works alright but i'm wondering if there's a Better Way. Each image is named like: foo_01.jpg, foo_02.jpg, bar_01.jpg, and so