On the circular judgment
Like I read 10 messages from the data table.
Where the 5th output mode is
". $row 1[' title ']."
6th output Mode
- ". $row 1[' title ']."
10th output Mode
- ". $row 1[' title ']."
Every other one is
". $row 1[' title ']."
How do you write it?
Here's your own mess.
for ($i =0; $i <= $num; $i + +) {
if (? ):
echo "
". $row 1[' title ']."";
ElseIf (? ):
echo "
- ". $row 1[' title ']."
";
ElseIf (? )://Note the ELS using a word
echo "
- ". $row 1[' title ']."
";
Else
echo "
". $row 1[' title ']."";
endif
}
Or read 10 of messages
is a group of 5
Output is
How do you write it?
------to solve the idea----------------------
Basic algorithms
$a = array (1,2,3,4,5,6,7,8,9,10);
for ($i =0; $i <10; $i + +) {
if ($i% 5 = = 0)
Echo ($i? '' : '') . "
\ n";
echo "
- $i
\ n ";
}
Echo '
;
------to solve the idea----------------------
$row = Array (0,1,2,3,4,5,6,7,8,9,10,11);
foreach (Array_chunk ($row, 5) as $val) {
echo "
". " \ n ";
foreach ($val as $v) {
echo "
- " . $v. "
"." \ n ";
}
echo "
". " \ n ";
}