Monday, 26 August 2013

I would like to repeat two sets of characters to achieve a form

I would like to repeat two sets of characters to achieve a form

I would like to achieve this form:
---*---
--***--
-*****-
*******
So far, i've tried it like this:
$linii = 7;
for($i=0; $i<=$linii; $i+=2) {
echo str_repeat("*", $i)."<br/>";
}
?>
I don't really know where to go from here.

No comments:

Post a Comment