Tanabe Saori
asked on
Variable to change loop length each time it's called.
I have two random numbers that determine how many images are shown in two columns.
$set1 = mt_rand(1,$max);
$set2 = mt_rand(1,$max);
I forgot how to make a modded variable to change the loop length each time it's run: for ($z = 1; $z <= 2; $z++){
for ($pieces = 1; $set.$z; $pieces++){
$device .= "<img src= {$direct}{$dfiles[$pieces]} alt=''/>
";
}
}
can somebody help?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.