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

查看所有标签

The Apache Modules Book

The Apache Modules Book

Nick Kew / Prentice Hall PTR / 2007-02-05 / USD 54.99

"Do you learn best by example and experimentation? This book is ideal. Have your favorite editor and compiler ready-you'll encounter example code you'll want to try right away. You've picked the right......一起来看看 《The Apache Modules Book》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码