filename increment in php problem...
Posted: Sun Feb 01, 2004 6:25 pm
Hello there budding PHP coders. I figured since I've not really come up with any code that would get me to my "destination" I shouldn't really use the PHP - Code section as this is all... unknown really.
What I wish to do: Open files (images) with image names such as:
image001.gif
How I wish to do this: use a variable and increment each time which then loads the image onto the page.
The problem: you cannot go $var = 001; $var++;
Reason: 001 + 1 = would you believe it 1... preceding zeros seem to mean nothing OMG! lol Yes alright I was just making sure you wouldn't suggest this. Does anyone have any ideas how i would generate lists automatically that follow the pattern:
001 002 003 004 005 006 007 008 009 010 011
Ideas: increament the values and THEN place the preceeding zeros, but I don't know how to do this.
What I wish to do: Open files (images) with image names such as:
image001.gif
How I wish to do this: use a variable and increment each time which then loads the image onto the page.
The problem: you cannot go $var = 001; $var++;
Reason: 001 + 1 = would you believe it 1... preceding zeros seem to mean nothing OMG! lol Yes alright I was just making sure you wouldn't suggest this. Does anyone have any ideas how i would generate lists automatically that follow the pattern:
001 002 003 004 005 006 007 008 009 010 011
Ideas: increament the values and THEN place the preceeding zeros, but I don't know how to do this.