mirror of
https://github.com/php/doc-es.git
synced 2026-04-28 01:23:14 +02:00
037f252e0f
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@297968 c90b9560-bf6c-de11-be94-00142212c4b1
119 lines
3.5 KiB
XML
119 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: lboshell Status: ready -->
|
|
<refentry xml:id="function.min" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>min</refname>
|
|
<refpurpose>Encontrar el valor más bajo</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>min</methodname>
|
|
<methodparam><type>array</type><parameter>values</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>min</methodname>
|
|
<methodparam><type>mixed</type><parameter>value1</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>value2</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>value3...</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Si el primer y único parámetro es una matriz, <function>min</function>
|
|
devuelve el valor más bajo en esa matriz. Si al menos dos parámetros son
|
|
entregados, <function>min</function> devuelve el menor de estos valores.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
PHP evaluará un valor <type>string</type> no-numérico como
|
|
<literal>0</literal> si se compara con un <type>integer</type>, pero aun
|
|
devuelve la cadena si ésta es vista como el valor numérico más bajo. Si
|
|
varios argumentos evalúan a <literal>0</literal>,
|
|
<function>min</function> devolverá el valor de cadena alfanumérica más
|
|
bajo si se da alguna cadena, o de lo contrario se devuelve un
|
|
<literal>0</literal> numérico.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>valores</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Una matriz que contiene los valores.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<function>min</function> devuelve el valor más bajo numéricamente de los
|
|
parámetros.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplos de uso de <function>min</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo min(2, 3, 1, 6, 7); // 1
|
|
echo min(array(2, 4, 5)); // 2
|
|
|
|
echo min(0, 'hola'); // 0
|
|
echo min('hola', 0); // hola
|
|
echo min('hola', -1); // -1
|
|
|
|
// Con varias matrices, min las compara de izquierda a derecha
|
|
// así que en nuestro ejemplo: 2 == 2, pero 4 < 5
|
|
$val = min(array(2, 4, 8), array(2, 5, 1)); // array(2, 4, 8)
|
|
|
|
// Si se pasan una matriz y una no-matriz, la matriz nunca
|
|
// es devuelta ya que se considera el valor mayor
|
|
$val = min('cadena', array(2, 5, 7), 42); // cadena
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>max</function></member>
|
|
<member><function>count</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
|
|
-->
|