<meta charset="utf-8">
<?php
function out($fun,$num){
for($i=0;$i<=$num-1;$i++){
$fun($i,$num);
echo "<br>";
}
}
function in($i,$num){
for($j=1;$j<$num-$i;$j++){
echo " ";
}
for($k=0;$k<2*$i+1;$k++){
echo "*";
}
}
out("in",6);
本文共 275 字,大约阅读时间需要 1 分钟。
<meta charset="utf-8">
<?php
function out($fun,$num){
for($i=0;$i<=$num-1;$i++){
$fun($i,$num);
echo "<br>";
}
}
function in($i,$num){
for($j=1;$j<$num-$i;$j++){
echo " ";
}
for($k=0;$k<2*$i+1;$k++){
echo "*";
}
}
out("in",6);
转载于:https://blog.51cto.com/11116201/1752339