PHP str_repeat() 函数

PHP 教程 · 2019-01-29 23:12:31

实例

把字符串 "." 重复 13 次:

<?php
echo str_repeat(".",13);
?>

定义和用法

str_repeat() 函数把字符串重复指定的次数。

语法


str_repeat(string,repeat)


参数 描述
string 必需。规定要重复的字符串。
repeat 必需。规定字符串将被重复的次数。必须大于等于 0。

技术细节

返回值: 返回被重复的字符串。
PHP 版本: 4+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Algorithms to Live By

Algorithms to Live By

Brian Christian、Tom Griffiths / Henry Holt and Co. / 2016-4-19 / USD 30.00

A fascinating exploration of how insights from computer algorithms can be applied to our everyday lives, helping to solve common decision-making problems and illuminate the workings of the human mind ......一起来看看 《Algorithms to Live By》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具