for($i=1;$i<=$n;$i++) { for($j=1;$j<=$n-$i;$j++) echo(" "); for($j=1;$j<=2*$i-1;$j++) echo(" *"); echo("<br />"); } its a correct r not .........i work out it....i have some errors.....any one help me.. the output will be * * * * * * * * * * * * * * *