1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<!-- $Revision$ -->
3
- <!-- EN-Revision: 2d7dc57eb110e453c416d09a4e6a19de1506614c Maintainer: takagi Status: ready -->
3
+ <!-- EN-Revision: 8b5940cadeb4f1c8492f4a7f70743a2be807cf39 Maintainer: takagi Status: ready -->
4
4
<!-- CREDITS: hirokawa,shimooka -->
5
5
<refentry xml : id =" function.range" xmlns =" http://docbook.org/ns/docbook" >
6
6
<refnamediv >
59
59
<parameter >end</parameter > までの整数の配列を返します。
60
60
</para >
61
61
</refsect1 >
62
- <refsect1 role =" changelog" >
63
- &reftitle.changelog;
64
- <para >
65
- <informaltable >
66
- <tgroup cols =" 2" >
67
- <thead >
68
- <row >
69
- <entry >&Version; </entry >
70
- <entry >&Description; </entry >
71
- </row >
72
- </thead >
73
- <tbody >
74
- <row >
75
- <entry >5.0.0</entry >
76
- <entry >
77
- オプションのパラメータ <parameter >step</parameter > が追加されました。
78
- </entry >
79
- </row >
80
- <row >
81
- <entry >4.1.0 から 4.3.2</entry >
82
- <entry >
83
- PHP 4.1.0 から 4.3.2 までは、<function >range</function >
84
- は数値文字を文字 (string) として認識し、数値 (integer) としては認識しません。
85
- その代わり、文字列シーケンスが使用されます。例えば、
86
- <literal >"4242"</literal > は <literal >"4"</literal > として扱われます。
87
- </entry >
88
- </row >
89
- <row >
90
- <entry >4.1.0</entry >
91
- <entry >
92
- 4.1.0 より前のバージョンでは、<function >range</function > 関数は、
93
- 昇順の整数配列のみを生成しました。
94
- 文字シーケンス及び降順の配列のサポートが 4.1.0 で追加されました。
95
- 文字のシーケンスは一文字のみに限定されます。それより長い文字が指定された場合は、
96
- 最初の文字のみが使用されます。
97
- </entry >
98
- </row >
99
- </tbody >
100
- </tgroup >
101
- </informaltable >
102
- </para >
103
- </refsect1 >
104
62
<refsect1 role =" examples" >
105
63
&reftitle.examples;
106
64
<para >
@@ -114,13 +72,13 @@ foreach (range(0, 12) as $number) {
114
72
echo $number;
115
73
}
116
74
117
- // step 引数は PHP 5.0.0 以降で使用できます
75
+ // step 引数は
118
76
// array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
119
77
foreach (range(0, 100, 10) as $number) {
120
78
echo $number;
121
79
}
122
80
123
- // 文字列シーケンスは PHP 4.1.0 以降で使用できます
81
+ // 文字列シーケンス
124
82
// array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i');
125
83
foreach (range('a', 'i') as $letter) {
126
84
echo $letter;
@@ -135,6 +93,15 @@ foreach (range('c', 'a') as $letter) {
135
93
</example >
136
94
</para >
137
95
</refsect1 >
96
+ <refsect1 role =" notes" >
97
+ &reftitle.notes;
98
+ <note >
99
+ <para >
100
+ 文字列シーケンスは、長さが 1 のものだけに限られます。
101
+ 2 文字以上を指定した場合は、最初の 1 文字だけを使います。
102
+ </para >
103
+ </note >
104
+ </refsect1 >
138
105
<refsect1 role =" seealso" >
139
106
&reftitle.seealso;
140
107
<para >
0 commit comments