1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-25 23:52:16 +01:00
Files
archived-doc-ja/reference/array/functions/array-shift.xml
Tadashi Jokagi a.k.a. "ELF" or "Joe 7d5f50cf76 Sinc with en.
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@184989 c90b9560-bf6c-de11-be94-00142212c4b1
2005-04-24 16:03:28 +00:00

81 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 1.11 Maintainer: hirokawa Status: ready -->
<refentry id="function.array-shift">
<refnamediv>
<refname>array_shift</refname>
<refpurpose>配列の先頭から要素を一つ取り出す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>mixed</type><methodname>array_shift</methodname>
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_shift</function>は、<parameter>array</parameter>
の最初の値を取り出して返します。配列 <parameter>array</parameter>
は、要素一つ分だけ短くなり、全ての要素は前にずれます。
<parameter>array</parameter> が空の場合(または配列でない場合)、
&null;が返されます。
</para>
&array.resetspointer;
<example>
<title><function>array_shift</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$stack = array("orange", "banana", "apple", "raspberry");
$fruit = array_shift($stack);
print_r($stack);
?>
]]>
</programlisting>
<para>
<varname>$stack</varname>には3つの要素が残されます:
</para>
<screen role="php">
<![CDATA[
Array
(
[0] => banana
[1] => apple
[2] => raspberry
)
]]>
</screen>
<para>
そして<varname>$fruit</varname><literal>orange</literal>
割り当てられます。
</para>
</example>
<para>
<function>array_unshift</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
-->