php-doc-en/reference/strings/functions/str-repeat.xml
2020-12-05 14:30:42 +00:00

112 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.str-repeat" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>str_repeat</refname>
<refpurpose>Repeat a string</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>str_repeat</methodname>
<methodparam><type>string</type><parameter>string</parameter></methodparam>
<methodparam><type>int</type><parameter>times</parameter></methodparam>
</methodsynopsis>
<para>
Returns <parameter>string</parameter> repeated
<parameter>times</parameter> times.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>string</parameter></term>
<listitem>
<para>
The string to be repeated.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>times</parameter></term>
<listitem>
<para>
Number of time the <parameter>string</parameter> string should be
repeated.
</para>
<para>
<parameter>times</parameter> has to be greater than or equal to 0.
If the <parameter>times</parameter> is set to 0, the function
will return an empty string.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the repeated string.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>str_repeat</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo str_repeat("-=", 10);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
-=-=-=-=-=-=-=-=-=-=
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="control-structures.for">for</link></member>
<member><function>str_pad</function></member>
<member><function>substr_count</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->