1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-26 08:02:15 +01:00
Files
archived-doc-ja/reference/array/functions/array-unshift.xml
Yu Watanabe db829074f0 sync to en tree.
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@134972 c90b9560-bf6c-de11-be94-00142212c4b1
2003-07-13 12:51:24 +00:00

81 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<!-- sync: 1.7 -->
<refentry id="function.array-unshift">
<refnamediv>
<refname>array_unshift</refname>
<refpurpose> 一つ以上の要素を配列の最初に加える </refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>array_unshift</methodname>
<methodparam><type>array</type><parameter>array</parameter></methodparam>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_unshift</function>は、<parameter>array</parameter>
の先頭に指定された要素を加えます。リストの要素は全体として加えられるため、
加えられた要素の順番は変わらないことに注意してください。
</para>
<para>
処理後の<parameter>array</parameter>の要素の数を返します。
</para>
<para>
<example>
<title><function>array_unshift</function>の例</title>
<programlisting role="php">
<![CDATA[
<?php
$queue = array ("orange", "banana");
array_unshift ($queue, "apple", "raspberry");
?>
]]>
</programlisting>
<para>
結果として<varname>$queue</varname>は次のような要素を持つ
配列になります:
</para>
<screen role="php">
<![CDATA[
Array
(
[0] => apple
[1] => raspberry
[2] => orange
[3] => banana
)
]]>
</screen>
</example>
</para>
<para>
<function>array_shift</function>,
<function>array_push</function>,
<function>array_pop</function>も参照下さい。
</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:"../../../../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
-->