[Phpwm] Php Script
Paul Cooper
pgc at openadvantage.org
Thu May 25 09:51:13 BST 2006
Hi,
----- Liam <liam at datasave.ltd.uk> wrote:
> Hi There,
>
> ive now completed this, This is what i wrote,
Great!
Just so you know you're using a mix of two loop styles:
The for loop style;
<?
for ($directory = 5800; $directory <= 10210; $directory++) {
mkdir("C:\BigApache\Apache\htdocs\test\\" + $directory, 0777);
echo $directory;
}
?>
Or the while loop style;
<?
$directory = 5800;
while ($directory <= 10210) {
mkdir("C:\BigApache\Apache\htdocs\test\\" + $directory, 0777);
echo $directory;
$directory++;
}
?>
Which style you prefer is up to you, although there are certain situations where the where style is more flexible.
Regards,
Paul
> <?
> $DIRECTORY = 5800;
>
> for($i = 5800; $i <= 10210; $i++){
> mkdir("C:\BigApache\Apache\htdocs\test\\" + $DIRECTORY, 0777);
>
> $DIRECTORY++;
> echo $DIRECTORY."\n";
> }
> ?>
>
> And it worked. Thanks
>
> Liam
>
>
> ----- Original Message -----
> From: "Jono Bacon" <jonobacon at gmail.com>
> To: <phpwm at mailman.lug.org.uk>
> Sent: Wednesday, May 24, 2006 6:49 AM
> Subject: Re: [Phpwm] Php Script
>
>
> Hey,
>
> > apparently i need to use loops but didnt' cover it properly as it
> was only
> > a 2 day
> > course.
>
> We did cover for loops, and thats what you need to use here. Check
> the
> code on your USB keyring - there is a sample loop on there that we
> wrote at the start of the course. :)
>
> Jono
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm
--
Paul Cooper | Tel: 0121 634 1620
Assistant Director | Fax: 0121 634 1630
OpenAdvantage | http://www.openadvantage.org
More information about the Phpwm
mailing list