时间:2021-07-01 10:21:17 帮助过:3人阅读
for($r=1;$r<=$rows;$r++){
for($n=$rows;$n>$r;$n--){
echo " ";
}
for($m=0;$m<$r ;$m++){
echo "*";
}
echo "
";
}
$rows = 12;
echo '';这样就不变形了
for($r=1;$r<=$rows;$r++){
for($n=$rows;$n>$r;$n--){
echo " ";
}
for($m=0;$m<$r ;$m++){
echo "*";
}
echo PHP_EOL;
}