Re: Display character 'x' times
| From: | Steel | Date: | Tue, 19 Nov 2002 10:58:39 +0000 |
| Subject: | Re: Display character 'x' times | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125062@lists.php.net to get a copy of this message | ||
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:
bryantSPAMw@geocities.SPAM.com (25-Oct-2001 11:16)
--
The Same,
Steel mailto:asergey@inbox.ru
http://www.none.ru