mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 07:32:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@222583 c90b9560-bf6c-de11-be94-00142212c4b1
76 lines
2.3 KiB
XML
76 lines
2.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- EN-Revision: 1.9 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: shimooka -->
|
|
<refentry id="function.array-pad">
|
|
<refnamediv>
|
|
<refname>array_pad</refname>
|
|
<refpurpose>指定長、指定した値で配列を埋める</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>説明</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_pad</methodname>
|
|
<methodparam><type>array</type><parameter>input</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>pad_size</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>pad_value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_pad</function> は、<parameter>pad_size</parameter>
|
|
で指定した長さになるように値 <parameter>pad_value</parameter> で埋めて
|
|
<parameter>input</parameter> のコピーを返します。
|
|
<parameter>pad_size</parameter> が正の場合、配列の右側が埋められます。
|
|
負の場合、配列の左側が埋められます。
|
|
<parameter>pad_size</parameter> の絶対値が
|
|
<parameter>input</parameter> の長さ以下の場合、埋める処理は行われません。
|
|
一度に追加できる要素の最大数は 1048576 です。
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>array_pad</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$input = array(12, 10, 9);
|
|
|
|
$result = array_pad($input, 5, 0);
|
|
// 結果は、array(12, 10, 9, 0, 0) です。
|
|
|
|
$result = array_pad($input, -7, -1);
|
|
// 結果は、array(-1, -1, -1, -1, 12, 10, 9) です。
|
|
|
|
$result = array_pad($input, 2, "noop");
|
|
// 埋める処理は行われません。
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<function>array_fill</function> および
|
|
<function>range</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
|
|
-->
|