for
? 我没有看到for
.
foreach (range(1, 10) as $i) {
foreach ($names as $name) {
echo $name . ', ';
}
echo '<br />';
}
$names = array("Seb", "Ginna", "Shane", "Guy", "Jackie", "Frances", "John", "Alec", "Jon", "Sam", "Chris", "Paula");
foreach (range(1, 10) as $i) {
foreach ($names as $name) {
echo $name . ', ';
}
echo '<br />' . PHP_EOL;
}
现在输出:
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />
Seb, Ginna, Shane, Guy, Jackie, Frances, John, Alec, Jon, Sam, Chris, Paula, <br />