Repeat a command multiple times???
Posted: Thu Jun 10, 2004 12:55 pm
Hi,
does anyone know a way to do something X amount of times in sequence, for example, if I have an array of numbers and I want to print a star, *, X amount of times where X is the number.
So in the case above a star is printed times. What's the correct way to do this?
Thanks
does anyone know a way to do something X amount of times in sequence, for example, if I have an array of numbers and I want to print a star, *, X amount of times where X is the number.
Code: Select all
$array = array(4, 7, 9, 10, 56, 78, 99);
echo '*' * $array[0]; /*Not the way to do it but just to indicate what I'm trying to do*/Thanks