<?php
/*
*
**
***
****
*****
*/
for($line=1; $line<=5; ++$line){
for($pos=1; $pos<=$line; ++$pos){
echo '*';
}
echo '<br>';
}
/*
*
***
*****
*******
*********
*/
echo '<hr>';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
echo '*';
}
echo '<br>';
}
/*
*
***
*****
*******
*********
*/
echo '<hr>';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=5-$line; $pos<=$max; ++$pos){
echo ' ';
}
for($pos=1, $max=2*$line-1; $pos<=$max; ++$pos){
echo '*';
}
echo '<br>';
}
/*
*
* *
* *
* *
* *
*/
echo '<hr>';
for($line=1; $line<=5; ++$line){
for($pos=1, $max=5-$line; $pos<=$max; +&
打印星星*** php
最新推荐文章于 2021-03-26 20:47:32 发布