Hello. This is one simple but yet effective codeish, hope you find it helpful.
PHP Code:
<?php
$addingvar = '*'; // our pattern
$var = ''; // just to call variable
foreach(range(1,5) as $value) {
$var .= $addingvar;
echo $var . '<br />';
}
?>
What I did there was added two variables (one is our pattern, in this case * while another one is variable that will recieve pattern each time loop repeats).
foreach function is something you should already know of, if not check its manual . I added simple range function instead of doing array(1,2,3,4,5). If you have any other questions let me know.
Best regards, Dino
Bookmarks