超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<str_padstr_replace>
Last updated: Fri, 22 Jun 2007

str_repeat

(PHP 4 , PHP 5)

str_repeat -- Repeat a string

Description

string str_repeat ( string input, int multiplier)

Returns input_str repeated multiplier times. multiplier has to be greater than or equal to 0. If the multiplier is set to 0, the function will return an empty string.

例子 1. str_repeat() example

<?php
echo str_repeat("-=", 10);
?>

The above example will output:

-=-=-=-=-=-=-=-=-=-=

See also for, str_pad(), and substr_count().




add a note add a note User Contributed Notes
str_repeat
bryantSPAMw at geocities dot SPAM dot com
25-Oct-2001 07:16
(For the benefit of those searching the website:)

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.

<str_padstr_replace>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22