View unanswered posts | View active topics It is currently Mon Oct 03, 2022 1:43 pm



Reply to topic  [ 2 posts ] 
 Character control 
Author Message
Junior Member

Joined: Fri Mar 12, 2004 6:49 am
Posts: 1
Post 
Hello,

Bit new to PHP so bare with me..........

Here is the script:

<?php

$file = 1.jpg;
//number of times before it should loop back to 1
$loop = 20;
$filenext = $file +1;

print $filenext;

?>

What I need this little script to do is look at 1.jpg and increment it by 1 to 2.jpg

And then when it reaches a certain number controlled by a variable it goes back to 1.

Is this possible? I have no idea where to begin although I feel that the script above is a start? Can anyone point me in the right direction?

Cheers

Chris


Fri Mar 12, 2004 6:51 am
Report this post
Profile
Junior Member

Joined: Sat May 10, 2003 1:39 pm
Posts: 37
Post 
$fstart = 1;
$loop = 20;

for ($f = $fstart; $f <= $loop; $f++) {

$filenext = "$f.jpg";

echo "$filenext
";
}

_________________
Barand


Sat Mar 13, 2004 2:58 am
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.