1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/array/functions/array-pad.xml
Enrique Garcia Briones 51fe3e03a1 Agregando archivos traducidos
Adoptando otros


git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@167065 c90b9560-bf6c-de11-be94-00142212c4b1
2004-08-23 16:52:57 +00:00

79 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- EN-Revision: 1.7 Maintainer: baoengb Status: ready -->
<!-- splitted from ./es/functions/array.xml, last change in rev 1.1 -->
<refentry id="function.array-pad">
<refnamediv>
<refname>array_pad</refname>
<refpurpose>
Rellena una matriz con un valor hasta el tama&ntilde;o especificado
</refpurpose>
</refnamediv>
<refsect1>
<title>Descripci&oacute;n</title>
<methodsynopsis>
<type>array</type><methodname>array_pad</methodname>
<methodparam><type>array</type><parameter>entrada</parameter></methodparam>
<methodparam><type>int</type><parameter>tama_relleno</parameter></methodparam>
<methodparam><type>mixed</type><parameter>valor_relleno</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_pad</function> Devuelve una copia de la
<parameter>entrada</parameter> rellenada hasta el tama&ntilde;o
<parameter>tama_relleno</parameter> con el valor
<parameter>valor_relleno</parameter>. Si
<parameter>tama_relleno</parameter> es positivo, entonces la matriz es
rellenada por la derecha, y si es negativo, por la izquierda.
Si el valor absoluto de <parameter>tama_relleno</parameter> es menor o igual
que el tama&ntilde;o de la <parameter>entrada</parameter> no se produce
relleno alguno.
</para>
<para>
<example>
<title>Ejemplo de <function>array_pad</function></title>
<programlisting role="php">
<![CDATA[
<?php
$entrada = array (12, 10, 9);
$resultado = array_pad ($entrada, 5, 0);
// el resultado es array (12, 10, 9, 0, 0)
$resultado = array_pad ($entrada, -7, -1);
// el resultado es array (-1, -1, -1, -1, 12, 10, 9)
$resultado = array_pad ($entrada, 2, "no");
// no rellenado
?>
]]>
</programlisting>
</example>
</para>
<para>
Vea tambi&eacute;n <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
-->