hello all guys actually i am creating a code for php.
what i want to get with for loop. something will be like this .
*
**
***
****
*****
****
***
**
*
this thing i want to create right now i have this code .
<?php
$i = 1;
$end = 5;
$star = "*";
for($i; $i <= $end; $i++){
for($b=1; $b <= $i; $b++){
echo $star;
}
if($i == $end){
for($c=1; $c <= $end; $c++ ){
for($d=i; $d >= 2; $d--){
echo $star;
}
echo "<br>";
}
}
};
?>
and its working fine with
*
**
***
****
*****
but then i need opposite loop first 4 then 3 then 2 then 1 ..... so please help me where i am wrong thanks for your help..