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