[PHP] Display character 'x' times

2002-11-19 Thread Tjoumaidis Tasos
Hello to everybody,

I just want to display a character like D x times like DDD where x is a 
$variable i get from the database i cannot make it work like it is on 
perl (i don't even know if it is working the same way) and i can't find 
a reference in the manual on php.net, maybe it's a silly question but i 
am stuck at this moment.

Thx in advance.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Display character 'x' times - Solved

2002-11-19 Thread Tjoumaidis Tasos
Great, That's exactly what i was looking for, thx to the other guys as 
well and sorry for not mentioning the whole problem which was that i 
wanted to pass the value to a variable.


Steel wrote:
Hi Tjoumaidis,

Tuesday, November 19, 2002, 1:30:39 PM, I've got:

TT Hello to everybody,

TT I just want to display a character like D x times like DDD where x is a 
TT $variable i get from the database i cannot make it work like it is on 
TT perl (i don't even know if it is working the same way) and i can't find 
TT a reference in the manual on php.net, maybe it's a silly question but i 
TT am stuck at this moment.

TT Thx in advance.


$str=str_repeat('D',$mult);
This is the equivalent of Perl's x (repetition) operator,
for eg.  str_repeat(blah, 8) in PHP does the same thing
as blah x 8 in Perl.

Answer from PHP Manual.
Comment by:
[EMAIL PROTECTED] (25-Oct-2001 11:16)



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php