mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
111 lines
3.7 KiB
HTML
111 lines
3.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>重复一个字符串</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.str-repeat" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">str_repeat</h1>
|
||
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">str_repeat</span> — <span class="dc-title">重复一个字符串</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.str-repeat-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>str_repeat</strong></span>
|
||
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$input</code></span>
|
||
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$multiplier</code></span>
|
||
) : <span class="type">string</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
返回 <code class="parameter">input</code> 重复
|
||
<code class="parameter">multiplier</code> 次后的结果。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.str-repeat-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">input</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
待操作的字符串。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">multiplier</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<code class="parameter">input</code> 被重复的次数。
|
||
</p>
|
||
<p class="para">
|
||
<code class="parameter">multiplier</code> 必须大于等于 0。如果 <code class="parameter">multiplier</code> 被设置为 0,函数返回空字符串。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.str-repeat-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
返回重复后的字符串。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.str-repeat-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="example-5955">
|
||
<p><strong>Example #1 <span class="function"><strong>str_repeat()</strong></span> 范例</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">str_repeat</span><span style="color: #007700">(</span><span style="color: #DD0000">"-="</span><span style="color: #007700">, </span><span style="color: #0000BB">10</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
<div class="example-contents"><p>以上例程会输出:</p></div>
|
||
<div class="example-contents screen">
|
||
<div class="cdata"><pre>
|
||
-=-=-=-=-=-=-=-=-=-=
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 seealso" id="refsect1-function.str-repeat-seealso">
|
||
<h3 class="title">参见</h3>
|
||
<p class="para">
|
||
<ul class="simplelist">
|
||
<li class="member"><a href="control_structures.for.html" class="link">for</a></li>
|
||
<li class="member"><span class="function"><a href="str_pad.html" class="function" rel="rdfs-seeAlso">str_pad()</a> - 使用另一个字符串填充字符串为指定长度</span></li>
|
||
<li class="member"><span class="function"><a href="substr_count.html" class="function" rel="rdfs-seeAlso">substr_count()</a> - 计算字串出现的次数</span></li>
|
||
</ul>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |