(PHP 4, PHP 5, PHP 7, PHP 8)
str_repeat — 重复一个字符串
$string
$times
返回 string 重复 times 次后的结果。
string
times
待操作的字符串。
string 被重复的次数。
times 必须大于等于 0。如果 times 被设置为 0,函数返回空字符串。
返回重复后的字符串。
示例 #1 str_repeat() 示例
<?phpecho str_repeat("-=", 10);?>
以上示例会输出:
-=-=-=-=-=-=-=-=-=-=