mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 23:22:18 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@114768 c90b9560-bf6c-de11-be94-00142212c4b1
72 lines
2.3 KiB
XML
72 lines
2.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./fr/functions/array.xml, last change in rev 1.30 -->
|
|
<!-- last change to 'array-pad' in en/ tree in rev 1.2 -->
|
|
<refentry id="function.array-pad">
|
|
<refnamediv>
|
|
<refname>array_pad</refname>
|
|
<refpurpose>
|
|
Complète un tableau jusqu'à la longueur spécifiée,
|
|
avec une valeur.
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</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> retourne une copie du tableau
|
|
<parameter>input</parameter> complété jusqu'à la taille de
|
|
<parameter>pad_size</parameter> avec la valeur
|
|
<parameter>pad_value</parameter>. Si <parameter>pad_size</parameter> est positif,
|
|
alors le tableau est complété à droite, s'il est
|
|
négatif, il est complété à gauche. Si la valeur
|
|
absolue de <parameter>pad_size</parameter> est plus petite que la taille du
|
|
tableau <parameter>input</parameter>, alors le tableau n'est pas
|
|
complété.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>array_pad</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$input = array(12, 10, 9);
|
|
$result = array_pad($input, 5, 0);
|
|
// Le résultat est array (12, 10, 9, 0, 0)
|
|
$result = array_pad($input, -7, -1);
|
|
// Le résultat est array (-1, -1, -1, -1, 12, 10, 9)
|
|
$result = array_pad($input, 2, "noop");
|
|
// pas complété
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|