mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@302200 c90b9560-bf6c-de11-be94-00142212c4b1
170 lines
4.1 KiB
XML
170 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 9280b062469c57055455bd459718a9f7b9698186 Maintainer: jpberdejo Status: ready -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.array-keys">
|
|
<refnamediv>
|
|
<refname>array_keys</refname>
|
|
<refpurpose>Devuelve todas las claves de un array o un subconjunto de claves de un array</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_keys</methodname>
|
|
<methodparam><type>array</type><parameter>input</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>search_value</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>strict</parameter><initializer>false</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_keys</function> devuelve las claves, numéricas y
|
|
string, del array <parameter>input</parameter>.
|
|
</para>
|
|
<para>
|
|
Si se especifica el parámetro opcional <parameter>search_value</parameter>
|
|
entonces sólo las claves para ese valor se retornan. De lo contrario, todas
|
|
las claves del <parameter>input</parameter> se retornan.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>input</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un array que contiene las claves para retornar.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>search_value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Si se especifica, entonces sólo las claves que contienen ese valor se retornan.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>strict</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Determina si una comparación estricta (===) debe ser utilizada durante la búsqueda.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna un array de todas las claves en <parameter>input</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.0.0</entry>
|
|
<entry>
|
|
Añadido el parámetro <parameter>strict</parameter>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>array_keys</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$array = array(0 => 100, "color" => "red");
|
|
print_r(array_keys($array));
|
|
|
|
$array = array("blue", "red", "green", "blue", "blue");
|
|
print_r(array_keys($array, "blue"));
|
|
|
|
$array = array("color" => array("blue", "red", "green"),
|
|
"size" => array("small", "medium", "large"));
|
|
print_r(array_keys($array));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => 0
|
|
[1] => color
|
|
)
|
|
Array
|
|
(
|
|
[0] => 0
|
|
[1] => 3
|
|
[2] => 4
|
|
)
|
|
Array
|
|
(
|
|
[0] => color
|
|
[1] => size
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>array_values</function></member>
|
|
<member><function>array_key_exists</function></member>
|
|
<member><function>array_search</function></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|
|
|