My code is
<center>
<?php
for($i = 0; $i < 7 ; $i++) {
for($j = 0; $j < $i; $j++) {
echo "*";
}
echo "<br/>";
}
?>
<center>
But I want is pyramid with useing <center></center>
html tags.
My code is
<center>
<?php
for($i = 0; $i < 7 ; $i++) {
for($j = 0; $j < $i; $j++) {
echo "*";
}
echo "<br/>";
}
?>
<center>
But I want is pyramid with useing <center></center>
html tags.
You're looking for something like this:
<div class="text-center"><!-- or however you choose to center this -->
<?php
$w = 7;
for ($n = 0; $n < $w; $n++) {
echo str_repeat("-", $n) . "<br>";
}
?>
</div>