<?php
$num = 1;
$str = " ";
while($num <= 10){
if($num % 1 == 0){
$str .= $num." ";
}
$num++;
echo $str;
?>
问题是:怎么输出为纵向排列?帮忙答复一下?现在输出是横向排列。
1 <?php
2
3 $num = 1;
4
5 $str = " ";
6
7 while($num <= 10){
8
9 if($num % 1 == 0){
10
11 echo $num;
12
13 echo "\n";
14 }
15 $num++;
16 }
17 ?>