当前位置: 首页> 函数类别大全> str_repeat

str_repeat

重复一个字符串
名称:str_repeat
分类:字符串
所属语言:php
一句话介绍:把字符串重复指定的次数。

实例

把字符串 "Shanghai " 重复 5 次:

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">str_repeat</span><span class="token punctuation">(</span><span class="token string double-quoted-string">"Shanghai"</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

亲自试一试

同类函数
  • 将字符串转换为数组 str_split

    str_split

    将字符串转换为数组
  • 返回格式化的字符串 sprintf

    sprintf

    返回格式化的字符串
  • 查找字符串首次出现的位置(不区分大小写) stripos

    stripos

    查找字符串首次出现的位置(不区分大小写)
  • 使用“自然顺序”算法比较字符串(不区分大小写) strnatcasecmp

    strnatcasecmp

    使用“自然顺序”算法比较字符串(不区分大
  • 计算字符串的md5哈希值 md5

    md5

    计算字符串的md5哈希值
  • 解码一个 uuencode 编码的字符串 convert_uudecode

    convert_uudecode

    解码一个uuencode编码的字符串
  • 以 C 语言风格使用反斜线转义字符串中的字符 addcslashes

    addcslashes

    以C语言风格使用反斜线转义字符串中的字符
  • 将8位字符串转换为带引号的可打印字符串 quoted_printable_encode

    quoted_printable_encode

    将8位字符串转换为带引号的可打印字符串
热门文章