1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-29 10:52:21 +02:00
Files
archived-doc-es/reference/array/functions/array-unshift.xml
Yago Ferrer 4a2bed8052 More files from: 'lboshell'
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@297985 c90b9560-bf6c-de11-be94-00142212c4b1
2010-04-14 10:23:56 +00:00

87 lines
2.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<!-- EN-Revision: n/a Maintainer: baoengb Status: ready -->
<!-- splitted from ./es/functions/array.xml, last change in rev 1.1 -->
<refentry xml:id="function.array-unshift" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>array_unshift</refname>
<refpurpose>Introduce uno o más elementos al principio
de la matriz</refpurpose>
</refnamediv>
<refsect1>
<title>Descripción</title>
<methodsynopsis>
<type>int</type><methodname>array_unshift</methodname>
<methodparam><type>array</type><parameter role="reference">matriz</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> añade los elementos que se le
pasan al frente de la <parameter>matriz</parameter>. Nótese que la
lista de elementos es añadida como un todo, de modo que los
elementos añadidos mantienen su orden. Todos los ídices numéricos
de la matriz serán modificados para iniciar a contar desde cero
mientras que los índices alfanuméricos no serán
modificados.
</para>
<para>
Devuelve el número de elementos en la <parameter>matriz</parameter>.
</para>
<para>
<example>
<title>Ejemplo de <function>array_unshift</function></title>
<programlisting role="php">
<![CDATA[
<?php
$queue = array("orange", "banana");
array_unshift($queue, "apple", "raspberry");
?>
]]>
</programlisting>
<para>
Esto resultará que <varname>$queue</varname> tenga los siguientes
elementos:
</para>
<screen role="php">
<![CDATA[
Array
(
[0] => apple
[1] => raspberry
[2] => orange
[3] => banana
)
]]>
</screen>
</example>
</para>
<para>
Vea tambinén <function>array_shift</function>,
<function>array_push</function>, and
<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
-->