reference/strings/functions/str-pad.xml
1f0319dfed1968563fe4a3445c88cfc80cf71df0
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.str-pad">
3
+
<refentry xml:id="function.str-pad" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>str_pad</refname>
6
6
<refpurpose>Pad a string to a certain length with another string</refpurpose>
...
...
@@ -10,17 +10,17 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>str_pad</methodname>
13
-
<methodparam><type>string</type><parameter>input</parameter></methodparam>
14
-
<methodparam><type>int</type><parameter>pad_length</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>string</parameter></methodparam>
14
+
<methodparam><type>int</type><parameter>length</parameter></methodparam>
15
15
<methodparam choice="opt"><type>string</type><parameter>pad_string</parameter><initializer>" "</initializer></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>pad_type</parameter><initializer>STR_PAD_RIGHT</initializer></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter>pad_type</parameter><initializer><constant>STR_PAD_RIGHT</constant></initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
-
This function returns the <parameter>input</parameter> string
19
+
This function returns the <parameter>string</parameter> string
20
20
padded on the left, the right, or both sides to the specified
21
21
padding length. If the optional argument
22
22
<parameter>pad_string</parameter> is not supplied, the
23
-
<parameter>input</parameter> is padded with spaces, otherwise it
23
+
<parameter>string</parameter> is padded with spaces, otherwise it
24
24
is padded with characters from <parameter>pad_string</parameter>
25
25
up to the limit.
26
26
</para>
...
...
@@ -31,7 +31,7 @@
31
31
<para>
32
32
<variablelist>
33
33
<varlistentry>
34
-
<term><parameter>input</parameter></term>
34
+
<term><parameter>string</parameter></term>
35
35
<listitem>
36
36
<para>
37
37
The input string.
...
...
@@ -39,12 +39,13 @@
39
39
</listitem>
40
40
</varlistentry>
41
41
<varlistentry>
42
-
<term><parameter>pad_length</parameter></term>
42
+
<term><parameter>length</parameter></term>
43
43
<listitem>
44
44
<para>
45
-
If the value of <parameter>pad_length</parameter> is negative,
45
+
The desired length of the final padded string.
46
+
If the value of <parameter>length</parameter> is negative,
46
47
less than, or equal to the length of the input string, no padding
47
-
takes place, and <parameter>input</parameter> will be returned.
48
+
takes place, and <parameter>string</parameter> will be returned.
48
49
</para>
49
50
</listitem>
50
51
</varlistentry>
...
...
@@ -105,8 +106,16 @@ echo str_pad($input, 3, "*"); // produces "Alien"
105
106
</para>
106
107
</refsect1>
107
108

108
-
</refentry>
109
+
<refsect1 role="seealso">
110
+
&reftitle.seealso;
111
+
<para>
112
+
<simplelist>
113
+
<member><function>mb_str_pad</function></member>
114
+
</simplelist>
115
+
</para>
116
+
</refsect1>
109
117

118
+
</refentry>
110
119
<!-- Keep this comment at the end of the file
111
120
Local variables:
112
121
mode: sgml
113
122