[PHP-doc 250]またちょっと訳が・・・en/language/types.xml
Y.Watanabe
yuw @ msj.biglobe.ne.jp
2003年 7月 4日 (金) 13:44:15 JST
わたなべです。
en/language/types.xml 翻訳作業中っす。
1424行目あたりのひとつ段落が、
例によって意味はわかるのですがうまい日本語訳が・・・?です。
help me.
<para>
Note that the maximum integer key used for this <emphasis>need
not currently exist in the array</emphasis>. It simply must
have existed in the array at some time since the last time the
array was re-indexed. The following example illustrates:
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
// Create a simple array.
// 簡単な配列を生成します。
$array = array(1, 2, 3, 4, 5);
print_r($array);
// Now delete every item, but leave the array itself intact:
// 全てのアイテムを削除しますが、配列自体は削除しないでおきます。
foreach ($array as $i => $value) {
unset($array[$i]);
}
print_r($array);
// Append an item (note that the new key is 5, instead of 0 as you
// might expect).
// アイテムを追加します(新しい添え字は0ではなく
// 5となることに注意)
$array[] = 6;
print_r($array);
// Re-index:
// 添え字を振りなおします。
$array = array_values($array);
$array[] = 7;
print_r($array);
?>
]]>
</programlisting>
<para>
上の例は以下のような出力となります。
<screen>
<![CDATA[
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
)
Array
(
)
Array
(
[5] => 6
)
Array
(
[0] => 6
[1] => 7
)
]]>
</screen>
</para>
</informalexample>
PHP-doc メーリングリストの案内